Global
Global keyword

Declares a variable available anywhere throughout your Yuma program.

Syntax:

Global <varName> As <Type> [= <initialValue>]


When you declare a variable with the "Dim" keyword, this variable is available only to code in the same context. This is true even when this is the implicit context, i.e. not inside any method, module, or class.

The "Global" keyword allows you to declare a variable that's available to your entire Yuma program, regardless of context.

Restrictions:

* A Global statement must be at the implict context, that is, not inside any method, module, or class.
* It is invalid to have two or more Global statements with the same variable name.
* Unlike Dim, it is invalid to use "New <className>" as the type in the declaration. For example: instead of "Global now As New Date", you must use "Global now As Date = New Date".