I assumed that global variables are defined immediately under the "Project" heading at the top of the project hierarchy. Also, I assumed that the blue numbers next to them are the initial values. If so, then in the attached image, all the names with green dots next to them are global variables, correct?
And the blue numbers are the initial values, correct?
I have a bug where the global variable "sendLibrariesCC" is not being read correctly by a script (if it is, in fact, a global variable...). I set the value in one script, then another script executes with an "if" statement dependent upon the value of that variable. However, the script is not executing properly given the state of the variable. So I'm just trying to confirm that I do, in fact, have a global variable. If the variable is not global then that could explain the behavior.
I can't find this info in the manual.
Thanks,
rgames
How do you define and initialize a global variable?
How do you define and initialize a global variable?
- Attachments
-
- GlobalVars.jpg (20.96 KiB) Viewed 1337 times
Re: How do you define and initialize a global variable?
Those are indeed global variables. Those variables can be read/changed from anywhere.The blue numbers represent the initial values given to them. If you change the value with a script those blue numbers won't change(unfortunately).. So I guess there is an error in your execution script.
Cheers!
Cheers!
"Having no silence in music is like having no black or white in a painting" - Brian Eno
https://soundcloud.com/mrcorba
https://soundcloud.com/mrcorba
Re: How do you define and initialize a global variable?
Great- thanks!
Off to look elsewhere for the problem...
Off to look elsewhere for the problem...
-
- Newbie
- Posts: 24
- Joined: 21 Nov 2015 23:51
Re: How do you define and initialize a global variable?
MrCorba's response is correct. Elaborating a bit, if you want to use a variable across multiple scripts, it must be defined as a global variable at the project level. Some projects will define the variable as zero and automatically regenerate the needed values in the scripts. Global arrays are also defined this way, but values are always defined in the scripts.