DADiSP Worksheet Functions > Function Categories > Query Functions > ISVARIABLE
Determines whether a variable or function is defined as the specified type.
ISVARIABLE("name", vartype)
"name" |
- |
A string, the variable name. |
||||||||||||||||||
vartype |
- |
Optional. An integer, the type of variable:
|
A 1 if the function or variable exists as specified, else returns a 0.
a = grand(100, 0.01)
b := max(a)
isvariable(a,1) == 1
isvariable(b,1) == 1
isvariable(b,4) == 1
isvariable(b,2) == 0
isvariable("fft",10) == 1
isvariable("myfft",10) == 0
Note that all hot variables are global variables.
The following macros are defined in system.mac:
isglobal(v) isvariable(v,1)
islocal(v) isvariable(v,2)
isspl(v) isvariable(v,3)
ishotvar(v) isvariable(v,4)
isformal(v) isvariable(v,5)
isnonlocal(v) isvariable(v,7)
isbuiltin(v) isvariable(v,10)
isstatic(v) isvariable(v,11)
ISVARIABLE and ARGC are useful in detecting optional arguments to an SPL function.
ISVARIABLE can be abbreviated ISVAR.