Post Reply 
Export Local Variables to use Globally
06-01-2018, 01:51 PM
Post: #1
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?
   
   
   
Find all posts by this user
Quote this message in a reply
06-01-2018, 02:07 PM
Post: #2
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?
Find all posts by this user
Quote this message in a reply
06-01-2018, 02:18 PM
Post: #3
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.
Find all posts by this user
Quote this message in a reply
06-03-2018, 01:21 AM
Post: #4
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
Find all posts by this user
Quote this message in a reply
06-04-2018, 04:56 AM
Post: #5
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.
Find all posts by this user
Quote this message in a reply
Post Reply 




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