DADiSP Worksheet Functions > Function Categories > Variables > DEFVAR
Sets the value of a global variable if the variable is undefined.
DEFVAR("name", value)
"name" |
- |
A string. The name of the global variable. |
value |
- |
A string, scalar, series or table, the value to assign if the variable is undefined. |
Nothing. Defines and sets the variable if it is undefined.
defvar("myvar", 10)
If myvar is undefined, myvar is set to 10.0
DEFVAR is used by several panels and SPL routines to create variables that behave similar to C/C++ static variables.