Guidelines
The HP Community is where owners of HP products, like you, volunteer to help each other find solutions.
Archived This topic has been archived. Information and links in this thread may no longer be available or relevant. If you have a question create a new topic by clicking here and select the appropriate board.
HP Recommended
HP Prime
Other

This may not be an issue. I expect that all commands are not useable in a program, particularly those that are out of the mainstream. What I was wondering was if someone has identified a work around to the following problem.

 

I attempted to use the table() command in a program as follows:

EXPORT TableTest()

BEGIN

local t;

t:=table("a"=1,"b"=2);

msgbox(t["a"]);

END;

 

The t["a"] term results in "Error: Invalid input". Entering the lines t:=table("a"=1,"b"=2); and msgbox(t["a"]); in the CAS view results in the expected result of 1.

 

Thanks for reviewing this and for any time taken to provide feedback.

6 REPLIES 6
HP Recommended

Hi!, @dimitrik:

 

In the page Ctlg Menu 461, of the Manual (https://support.hp.com/us-en/product/hp-prime-graphing-calculator/5367459/manuals) ... table, Defines an array where the indexes are strings or real numbers.  

 

table(SeqEqual(index_name=element_value))

 

  • A through Z can only contain real numbers.
  • M0 through M9 can only contain arrays (vectors or matrices).
Kind Regards !.
Have a nice day !.
@Maké (Technical Advisor Premium - HP Program Top Contributor).
Provost in HP Spanish Public Forum ... https://h30467.www3.hp.com/
HP Recommended

I would not recommend using the "table" command. The problem is that this was a command of which we (HP) didn't even know about and was included as part of the CAS provided by a 3rd party. It currently seems to have some problems, isn't documented, and hasn't been tested at all on our side. I'm not surprised to see it has problems with home/CAS interactions.

 

I've filed a report to make sure we look at it and figure out either how to make it behave better, or else just remove it completely.

TW

Although I work for the HP calculator group as a head developer of the HP Prime, the views and opinions I post here are my own.
HP Recommended

Thank you for your prompt response Tim.

 

Interestingly enough, the command shows up (barely mentioned) in the HP Prime manual, Chapter 22, pg 454. I must admit that I did get most of the info on its usage from the third party's CAS command reference.

 

I will code an equivalent function, which shouldn't be hard given the power and versatility of the calculator.

 

Again, many thanks for your advice and your warm welcome to the membership.

 

Jim

HP Recommended

Thanks for that Maké. I appreciate the help.

 

I will take Tim's advice and refrain from using the command in my program.

 

Very best,

Jim

HP Recommended

Because table is a CAS command it cannot be used simply in a non-CAS program, but in a CAS program it works:

 

undefined

HP Recommended

It is also possible to use a CAS command in a non- CAS program, but then it becomes more complicated.

 

In this case a possibility is to use the construction CAS(" ......"), where the dots represent the CAS command.

 

In our case it is even more complicated because we get quotes inside quotes, and to let this work well we have to replace the inner quotes by double quotes.

 

Then our program becomes:

undefined

 

Note that in this case t is not a local variable but we created a global CAS variable

Archived This topic has been archived. Information and links in this thread may no longer be available or relevant. If you have a question create a new topic by clicking here and select the appropriate board.
† The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the <a href="https://www8.hp.com/us/en/terms-of-use.html" class="udrlinesmall">Terms of Use</a> and <a href="/t5/custom/page/page-id/hp.rulespage" class="udrlinesmall"> Rules of Participation</a>.