Check if a variable has been declared.
IsDeclared ( expression )
| expression | string representing name of the variable to be checked. |
| 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. |
If Not IsDeclared("a") Then
MsgBox(0, "", "$a is NOT declared") ; $a has never been assigned
EndIf
Local $a = 1
If IsDeclared("a") Then
MsgBox(0, "", "$a IS declared") ; due to previous $a=1 assignment
EndIf