OPTION
OPTION optionName
Option allows toggling on various behaviors for the interpreter.
The only option currently supported is Option Explicit, which will cause wxBasic to generate an error when it encounters a reference to a variable that has not been declared. Without Option Explicit, the variable a will be automatically declared for you:
' Without OPTION EXPLICIT, variables are created "on demand"
a = 12
However, with Option Explict, the same code will generate an error, since a has not been explicitly declared:
' Generates an error, because it is not declared:
Option Explicit
a = 12
With Option Explicit, you must declare all variables before use:
' No error, a is declared before use
Option Explicit
Dim a
a = 12
This is true even for global variables. To use global variables with Option Explicit, use Shared.