DEFSYSV procedure creates a new
system variable called
Name, Value [, Read_Only]
A scalar string containing the name of the system variable to be created. All system variable names must begin with the character `!'.
An expression from which the type, structure, and initial value of the new system variable is taken.
can be a scalar, array, or structure.
argument is present and nonzero, the value of the
newly-created system variable cannot be changed (i.e., the system variable is read-only, like the !PI system variable). Otherwise, the value of the new system variable can be modified.
Set this keyword to a named variable that returns 1 if the system variable specified by
exists. If this keyword is specified,
can be omitted. For example, the following commands could be used to check that the system variable XYZ exists:
DEFSYSV, '!XYZ', EXISTS = i
IF i EQ 1 THEN PRINT, '!XYZ exists' ELSE PRINT, '!XYZ does not exist'
To create a new, floating-point, scalar system variable called !NEWVAR with an initial value of 2.0, enter:
DEFSYSV, '!NEWVAR', 2.0
You can both define and use a system variable within a single procedure:
DEFSYSV, '!foo', 'Rocky, watch me pull a squirrel out of my hat!'