Custom Globals consist of a sequence of LSL variable and function declaration statements that have been manually entered by the User into the MiceOnABeam model (via the menu item Custom Globals... within the Script menu of the program). These declarations are global to the generated code and can be accessed from within any model components that provide for user-entered code.
In most cases it is advisable for Users to take advantage of the State Variables & Functions feature, whereby access to variables and functions is limited to the scope of the states (and contained states) in which they are defined.
However there are cases when a large number of global variables or functions are required and are intended to be global to the entire script. In these situations entering these variables and functions through the user interface provided for state variables and functions might prove to be unwieldy and counter-productive, so the Custom Globals facility is provided to address this.
Note that within the Custom Globals Editor, function and variable declarations can be entered in any order and references within other functions will still be resolved correctly.
The Custom Globals declarations are simply inserted into the generated code.
Note that only variable and function declarations as well as Compiler Directives are permitted within Custom Globals.