&&exists

From m204wiki
Revision as of 19:41, 18 August 2022 by Ekern (talk | contribs) (Created page with "__TOC__ {| |width="50%"| '''Action:''' |width="50%"| <span class="f_Para">Tests if a macro variable is defined. </span> '''Syntax:'''...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


Action:

Tests if a macro variable is defined.

Syntax:

&&exists(variableName) 

where variableName is the macro variable whose existence is being checked.

If the named variable exists, &&exists returns 1; otherwise, it returns 0.  

A variable is deemed to "not exist" in these cases:

  • It has not been defined since the Debugger Client was last started or restarted.
  • It has been defined, but it was removed with the unset command.

Examples:

The following statement returns 0:

echo &&exists("&neverSet") 

The echo statement below returns 1:

set &i = 666  echo &&exists("&i") 

The echo statement below returns 0:

unset &i  echo &&exists("&i") 

Introduced: Build 60