Check if a variable has been declared.
IsDeclared ( expression )
Parameters
expression | string representing name of the variable to be checked. |
Return Value
Success: | Returns 1 for Global variable or variable declared outside functions. |
Special: | -1 for Local variable. |
Failure: | Return 0 when no variable can be found. |
Remarks
None.
Related
Eval
Example
If Not IsDeclared ("a") then
MsgBox(0,"", "$a is NOT declared") ; $a has never been assigned
EndIf
$a=1
If IsDeclared ("a") then
MsgBox(0,"", "$a IS declared" ) ; due to previous $a=1 assignment
EndIf