Scripting Language Elements
Global variables are declared outside any subroutine or function, using the Dim or Global statements, and are accessible throughout the entire script. In addition, when a script ends execution, Global variables are stored in the Bzshvars.ini file, located in the BlueZone Working directory. Subsequent running of scripts that use referenced Global variables will have their values initialized to the stored values before script execution. This allows for variable sharing across multiple instances of the script host. A Global variable should be initialized in the script if it does not want to use the stored value.
Global variables are cleared when the last instance of a BlueZone emulator session is closed, or if the Bzshvars.ini file is deleted.
Example:
Dim x As Integer
Sub Main
MsgBox x
x = 10
End Sub
A message box displays 0 the first time the script is run, and 10 on subsequent running of the script.