-
×InformationNeed Windows 11 help?Check documents on compatibility, FAQs, upgrade information and available fixes.
Windows 11 Support Center. -
-
×InformationNeed Windows 11 help?Check documents on compatibility, FAQs, upgrade information and available fixes.
Windows 11 Support Center. -
- HP Community
- Archived Topics
- Tablets and Mobile Devices Archive
- Re: HP Prime table() command not usable in a program

Create an account on the HP Community to personalize your profile and ask a question

04-18-2017 08:13 PM
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.
04-19-2017 07:47 AM - edited 04-19-2017 08:01 AM
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).
Have a nice day !.
@Maké (Technical Advisor Premium - HP Program Top Contributor).
Provost in HP Spanish Public Forum ... https://h30467.www3.hp.com/
04-19-2017 12:10 PM
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.
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.
04-19-2017 03:40 PM
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
04-22-2017 06:03 AM
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:
Note that in this case t is not a local variable but we created a global CAS variable
