Table of Contents

isdef

Description

Test whether a named variable exists.

Function prototype

bool isdef <string:VarName>

Arguments

Name Type Comment
VarName string The name of a variable, the existence of which is to be tested.

Return value

True if the variable named by VarName exists, and false otherwise.

Example

// create a variable called "i" and then test whether it exists using isdef and echo
int i

if <zs:isdef "i">
  echo "true"
else
  echo "false"
endif

… the output of which is written to the event log by echo as:

true

Comments

None.

See also