Check if a variable has been declared.
IsDeclared ( expression )
If there is a need to use IsDeclared() to check that a variable exists, then in most situations Assign() should be used to create/write to the variable and Eval() should be used to read from the variable.
#include <MsgBoxConstants.au3>
; Check if the variable $vVar is declared. As the variable isn't will display the error message.
If Not IsDeclared ("vVar")Then
MsgBox ($MB_SYSTEMMODAL,"","The variable $vVar is not declared.")
Local $vVar= 0; Initialize the variable $vVar with data.
If IsDeclared ("vVar")Then ; Check if the variable $vVar is declared.
MsgBox ($MB_SYSTEMMODAL,"","The variable $vVar is declared.")
Else
MsgBox ($MB_SYSTEMMODAL,"","The variable $vVar is not declared.")
EndIf
EndIf