Post Reply 
Creating App Variables
12-26-2013, 01:44 PM
Post: #1
Creating App Variables
Does anyone know how to create new App variables?

I can add code to an app, modify (or rewrite) its views and generally make it behave as i want. What I haven't figured out, is how to create variables that are bound to an app, do not appear in the user variable list and retain their values.

Since the Prime does not have a directory structure it seems that the only way to create a group of persistent data items for a specific purpose is to embed them in an app. I just can't figure out how to do it.
Find all posts by this user
Quote this message in a reply
12-26-2013, 02:13 PM (This post was last modified: 12-26-2013 02:16 PM by Michael de Estrada.)
Post: #2
RE: Creating App Variables
You can do this as follows:

1. Take any App, say Spreadsheet, and save it under a different name, say Test.

2. Select it as the active App and go to the Program Catalog. It will appear at the top of the list as Test (App).

3. Open it in the editor and you will see the program template. Insert your desired bound variable at the top, e.g.:

App_Test_Var;
EXPORT TEST()
BEGIN

END;

4. Exit the editor and return to Home or CAS view. You will find this variable bound to this App:

Vars > App > Test > Program > App_Test_Var
Find all posts by this user
Quote this message in a reply
12-26-2013, 03:31 PM
Post: #3
RE: Creating App Variables
Michael,

Thanks. It was simpler than I thought. I was hoping there was a way for the app variables to appear in the connection kit under a tab (like Results or Plot) where the default values could be edited. But I can live with it the way it is.

-- jeff
Find all posts by this user
Quote this message in a reply
12-26-2013, 03:41 PM
Post: #4
RE: Creating App Variables
If you'd like there to be certain default values, you just need to initialize to those values in the source. Remember though, that happens on *compile* time of the program source file - not on runtime.

App_Test_Var:=42;

TW

Although I work for HP, the views and opinions I post here are my own.
Find all posts by this user
Quote this message in a reply
Post Reply 




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