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. For more information on modules, see Code, Class, and Object Modules.

See Also

Introducing Scripter

Variables

Object Variables

User-Defined Types

Object Hierarchy

Operators

Overview of Surfer Objects