<< Click to Display Table of Contents >> Navigation: Reference > Declarations > Var declarations |
You can declare global variables and local variables. The general syntax for a declaration is:
Var identifier : type [optional initialization]
If you want to declare multiple variables of the same type, just separate them with a comma:
Var i, j, k : integer [optional initialization]
If you are declaring multiple variables one after the other, you do not repeat the var keyword.
Var i : integer [optional initialization]
s : string [optional initialization]
n : NoteMessage [optional initialization]
Global variables are defined outside of any callbacks or user-defined functions and are visible only from the point at which you declare them. Certain types such as Plugins, Widgets and function generators (ADSR, Ramp, etc.,) can only be declared at global scope.
SysEx messages can be defined as well (more on SysEx messages below).