Export Local Variables to use Globally
06-01-2018, 01:51 PM
Post: #1
 mathnovice Junior Member Posts: 7 Joined: Jun 2018
Export Local Variables to use Globally
I have borrow a Kinematics solve program and have been editing it. I have made local variables and they are common to the 5 programs that I have made (due to only having the ability to input 10 equations per program). I have made my local variables common to all programs e.g gravity = g, change in time = (delta)t for all. When I solve for some local variable in Kinematics g program I want that same variable to to have the same value when I switch to Kinematics PROJ program. Is the possible?

06-01-2018, 02:07 PM
Post: #2
 toml_12953 Senior Member Posts: 2,140 Joined: Dec 2013
RE: Export Local Variables to use Globally
(06-01-2018 01:51 PM)mathnovice Wrote:  I have borrow a Kinematics solve program and have been editing it. I have made local variables and they are common to the 5 programs that I have made (due to only having the ability to input 10 equations per program). I have made my local variables common to all programs e.g gravity = g, change in time = (delta)t for all. When I solve for some local variable in Kinematics g program I want that same variable to to have the same value when I switch to Kinematics PROJ program. Is the possible?

I believe if you use the uppercase variables A - Z and don't declare them local, they're available to all programs and apps.

Tom L
Cui bono?
06-01-2018, 02:18 PM
Post: #3
 mathnovice Junior Member Posts: 7 Joined: Jun 2018
RE: Export Local Variables to use Globally
yes this is true. Kinematics are already a mess with all the variables that they use: y final, y initial, delta x, delta t....and many more. As an example on the Y axis: I need "Y final, Y initial, (Delta)Y. Sure I could use Y, F, I, but I also need final/initial/delta for X axis, X is easy enough but what to use for F and I, using A & B would be too confusing (x final = A and X intial = B, that would be tough to keep track of.) That is why I made local variables. I tried that route first and ran into confusion since to the best of my knowledge only uppercase letters are global from HP.
06-03-2018, 01:21 AM
Post: #4
 BERNARD MICHAUD Member Posts: 149 Joined: Aug 2015
RE: Export Local Variables to use Globally
Use the command [/color]EXPORT yfinal,gravity,deltaT;. Maximum 8 vars per line at the begining of the program. These variables then become Global and can be used in any part of the program or even other programs.

BM
06-04-2018, 04:56 AM
Post: #5
 cyrille de brĂ©bisson Senior Member Posts: 1,047 Joined: Dec 2013
RE: Export Local Variables to use Globally
Hello,

Program variables declared OUTSIDE of a function are global (meaning that they exist from the moment the file is compiled and keep their value until the program is recompiled or erased).

Such global variables, if they are NOT in an app program, AND if they are declared with "EXPORT" will be accessible from anywhere just by typing their name.

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.
 « Next Oldest | Next Newest »

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