HP Forums
Creating App 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: Creating App Variables (/thread-242.html)

Creating App Variables - jgreenb2 - 12-26-2013 01:44 PM

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.

RE: Creating App Variables - Michael de Estrada - 12-26-2013 02:13 PM

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.:



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

RE: Creating App Variables - jgreenb2 - 12-26-2013 03:31 PM


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

RE: Creating App Variables - Tim Wessman - 12-26-2013 03:41 PM

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.