Post Reply 
Help! How to access App's variables?
04-23-2016, 08:56 PM (This post was last modified: 04-23-2016 10:35 PM by Spybot.)
Post: #1
Help! How to access App's variables?
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!

Spybot.
Find all posts by this user
Quote this message in a reply
04-23-2016, 10:31 PM
Post: #2
RE: Help! How to access App's variables?
Hi Spybot!
You have to use STARTVIEW(,) command.

If you have AstroLab 4, check for exemple the Jupiter Satellites View... you will see...
Marcel
Find all posts by this user
Quote this message in a reply
04-23-2016, 10:36 PM
Post: #3
RE: Help! How to access App's variables?
Thanks Marcel... I'll check it out.

Spybot.
Find all posts by this user
Quote this message in a reply
04-23-2016, 10:58 PM
Post: #4
RE: Help! How to access App's variables?
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
Find all posts by this user
Quote this message in a reply
04-25-2016, 03:12 PM
Post: #5
RE: Help! How to access App's variables?
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.

TW

Although I work for the HP calculator group, the views and opinions I post here are my own.
Find all posts by this user
Quote this message in a reply
04-26-2016, 03:23 PM
Post: #6
RE: Help! How to access App's variables?
Thanks Tim, I'll keep on testing.

Spybot.
Find all posts by this user
Quote this message in a reply
04-27-2016, 06:13 AM
Post: #7
RE: Help! How to access App's variables?
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

Although I work for the HP calculator group, the views and opinions I post here are my own. I do not speak for HP.
Find all posts by this user
Quote this message in a reply
04-29-2016, 01:14 AM
Post: #8
RE: Help! How to access App's variables?
Thank you very much Cyrille.
The information you provided is been very helpful to me.

Spybot.
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)