Global Variables

In Scripter, variables declared in the body of a subroutine or function are available only within that procedure. If you want to share the same variable throughout a script file, then you can define it at the top of the file, before any subroutine definitions. Variables declared at the top of the file are available to all subroutines in the file; hence, they are called "global" variables.

 

The PUBLIC keyword may be substituted for the Dim keyword to allow a global variable to be used in other modules.

 

 

See Also

Variables

Object Variables

Array Variables

User-Defined Types

Scripter BASIC Language