Page 1 of 1

Creating a global variable that can be accessed anywhere

Posted: 19 Oct 2016 12:50
by GV1
Sorry for another post. I'm digging deep into this lemur scripting and hitting a few issues.

I need to create a global variable. This will store an integer value. In my example it's the octave. The variable needs to be accessed by other functions. For example, when pressing a button I need to increment the variable and update the display to show the octave value.

The only part that's puzzling me is global variables. How do I define one that can be accessed at any point?

Initially I had seen people suggesting using labels within a hidden container. But this poses a problem because the value is a string, and strings can't be incremented or used with math functions (at least to my knowledge) and I can't find any way of converting a string to an integer.

I have also tried creating a script at the project level and declaring a variable within that which didn't seem to work for me.

Any help on defining a global variable would be appreciated.

Re: Creating a global variable that can be accessed anywhere

Posted: 19 Oct 2016 13:36
by GV1
Ignore me. An expression works fine. Do not ask me why I tried to over complicate that lmao!