Creating a global variable that can be accessed anywhere

Discuss Lemur and share techniques.
Post Reply
GV1
Newbie
Posts:38
Joined:03 Jan 2012 19:33
Creating a global variable that can be accessed anywhere

Post by GV1 » 19 Oct 2016 12:50

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.

GV1
Newbie
Posts:38
Joined:03 Jan 2012 19:33

Re: Creating a global variable that can be accessed anywhere

Post by GV1 » 19 Oct 2016 13:36

Ignore me. An expression works fine. Do not ask me why I tried to over complicate that lmao!

Post Reply