Static
DescriptionStatic <variable> [,<variable>,...]
Static allows to create a local persistent variable in a Procedure even if the same variable has been declared as Global in the main program.
The value of the variable isn't reinitialized at each procedure call, means you can use local variables parallel to global variables (with the same name), and both will keep their values.
Beside Static you can use the keyword Protected, to separate global from local variables, but with Protected the local variables will not keep their values.Example:
Global a a = 10 Procedure Change() Static a a+1 PrintN("In Procedure: "+Str(a)) ; Will print 1, 2, 3 as the variable increments at each procedure call. EndProcedure If OpenConsole() Change() Change() Change() PrintN(Str(a)) ; Will print 10, as the static variable doesn't affect global one. Input() CloseConsole() EndIf