Declarations

<< Click to Display Table of Contents >>

Navigation:  Reference >

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.