HP Forums
Help! How to access App's variables? - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: Help! How to access App's variables? (/thread-6117.html)



Help! How to access App's variables? - Spybot - 04-23-2016 08:56 PM

Hello!
I'm trying to implement a graphical interface for a program, and I need to create some variables within the Geometry App (points, segments, lines etc...) so when I STARTAPP the Geometry App it shows all the stuff I created earlier. I already tried creating variables GA, GB, GC... etc but they don't show in the Geometry's plot view.
Does anyone know how this is done?

EXPORT aaa()
BEGIN
LOCAL GA,GB,GC;
GA:=point(1,1);
GB:=point(5,6);
GC:=segment(GA,GB);
STARTAPP("Geometry");
END;

this code does pretty much nothing!


RE: Help! How to access App's variables? - Marcel - 04-23-2016 10:31 PM

Hi Spybot!
You have to use STARTVIEW(,) command.

If you have AstroLab 4, check for exemple the Jupiter Satellites View... you will see...
Marcel


RE: Help! How to access App's variables? - Spybot - 04-23-2016 10:36 PM

Thanks Marcel... I'll check it out.


RE: Help! How to access App's variables? - Arno K - 04-23-2016 10:58 PM

Using STARTVIEW alone will not be enough, you have to deal with the Instruction command of which I show a small example in my Taylorani-app which you can find here.
Hth Arno


RE: Help! How to access App's variables? - Tim Wessman - 04-25-2016 03:12 PM

Geometry is kind of a strange beast. Basically, it is a full CAS environment isolated from the system in a way. (otherwise you'd delete all your geometry variables when doing restart() in the CAS)

This necessitated the need for those Instruction():= DelInstruction commands as stated. You can directly recall them and use the values, but not store directly in. We hope to be able to improve this at some point.


RE: Help! How to access App's variables? - Spybot - 04-26-2016 03:23 PM

Thanks Tim, I'll keep on testing.


RE: Help! How to access App's variables? - cyrille de brébisson - 04-27-2016 06:13 AM

Hello,

Geometry is such a poor, misunderstood app... sniff...

What most people do not understand is that a geometry variable GC, for example does NOT contain line(GA, GB), but it contains the result of the evaluation of line(GA, GB). Which happen to be a graphical CAS command describing a line.

When you go in the geometry symbolic view, what you see is a PROGRAM! and the execution of that program, sequentially, from top to bottom, does generate/assign values to variables, these values containing graphical descriptions.

Each time you change/modify a 'point', the whole program is re-evaluated.

This is why you can not affect an instruction value to GA (well, you can but it will not persist long), because on next evaluation of the program whatever you placed there will be overridden.

As stated above, this is what the "Instruction" app variable is for. To let you interract with the geometry program.

In your case, assuming that geometry is the current app, this line should do it.

Instruction:="GA:= point(1.,1.); // c(FF000000) v(1) \nGB:= point(5.,6.); // c(FF000000) v(1) \nGC:= segment(GB,GA); // c(FF000000) v(1) \n"


Please read the help for Instruction for more information.
Regards,
Cyrille


RE: Help! How to access App's variables? - Spybot - 04-29-2016 01:14 AM

Thank you very much Cyrille.
The information you provided is been very helpful to me.