BigMike Posted March 5, 2010 Posted March 5, 2010 I am using a global variable to capture the current value in a field and then re-insert that value if the new value chosen is invalid (statuses must follow a pre-defined progression). If an invalid status is selected, I display a dialog that says the selected status is invalid and then my script inserts the value of the global variable to restore the status to the original value. I am thinking I will have a problem with a multi-user system (which this is). If my co-worker and I change statuses on two different items at the same time it looks like one of us may end up with the wrong status when finished. Are global variables restricted to my login or are they system wide? My guess is that there is one global variable for the entire system and therefore I may run into an issue with my current scenario. Any thoughts would be apprciated.
bcooney Posted March 5, 2010 Posted March 5, 2010 (edited) Global variables and global fields are session specific. Each user in a multi-user system has their own. Global fields default to the value that the field had when last closed as single user or what is explicitly set in a Startup script. Btw, I don't see the need for a $$var, why not just capture $orig_value? Edit: Why can't your system calculate status rather than have the user set it? Edited March 6, 2010 by Guest
BigMike Posted March 16, 2010 Author Posted March 16, 2010 bcooney, Thanks for the reply. This is good news. I was concerned that a global variable set by one user would be accidently referenced by another user logged on at the same time. Since globals are session specific this won't be an issue. My understanding is that you must preface a global variable with "$$". Otherwise it is considered a local variable if you only use a single "$". Is that not the case? This variabe is being set in one script and being referenced in another. Doesn't this require a "$$" before the name? Thanks again for your help.
bcooney Posted March 16, 2010 Posted March 16, 2010 There are two ways for one script to "know" about a value in another script. The first way is to use a $$var, since their values persist for the entire session, until set to nothing. Another way is to pass a value to the other script using a script parameter. I often use a subscript that returns "an answer" to a calling script using Exit Script ( myValue). Then in the the calling script use, Get Script Result. You do not need to declare a $var.
Recommended Posts
This topic is 5367 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now