VarExists() enables you to test for the existence of a variable. Use when you want to know if a variable has already been created or not . Remove the leading $ when passing the variable name to check.
$test = "abc"
If VarExists("test")
MsgOk Msg="Variable exists"
Endif