Programming Guide |
Declares global JPL variables
globalvarSpec
[,varSpec
]...
Specifies the global variable's name and properties as follows:
varName
[[numOccurs
]] [(size
)] [=initValue
]
varName
- The name of the variable, where
varName
is a string that contains up to 31 characters. Global names can use any combination of letters, digits, or underscores, where the first character is not a digit. Panther also allows usage of two special characters, the dollar sign ($) and period (.).- [
numOccurs
]- Optionally declares
varName
as an array ofnumOccurs
occurrences. The default number of occurrences is 1. For example the following statement declares dependents as an array of ten occurrences:global dependents
[10]- (
size
)- Optionally specifies the number of bytes allocated for this variable; Panther automatically allocates an extra byte for the terminating null character. The default size is 255 bytes. For example, the following statement declares the variable zip with a size of 10 bytes:
global zip
(10)- =
initValue
- Optionally initializes the variable to
initValue
, whereinitValue
can be any expression less than or equal to the variable's size. If no value is assigned, Panther initializes the variable to null string ("").If the variable is declared as an array, you can initialize its occurrences. For example:
global ratings[5] = {"G", "PG", "PG-13", "R", "NC-17"}
Occurrence values are comma-delimited, and can be any constants or variables that are in scope, including other global variables and widget names.
The
global
command creates one or more global JPL variables. These variables are visible to the entire application and can be referenced at any time.Avoid using names already in use by Panther itself–for example, logical key names such as
XMIT
andEXIT
, and bit mask settings such asK_EXPOSE
andK_ENTRY
. Because Panther uses these variables internally, reinitializing them can yield unpredictable and possibly harmful results.