The $DATA function returns an integer code describing the value and descendent status of a local or variable.
The format for the $DATA function is:
$D[ATA](glvn)
The subscripted or unsubscripted global or local variable name specifies the target node.
If the variable is undefined, $DATA() returns 0.
If the variable has a value but no descendants, $DATA() returns 1.
If the variable has descendants but no value, $DATA() returns 10.
If the variable has a value and descendants, $DATA() returns 11.
The following table summarizes $DATA() return values.
$DATA() Results |
|||
VALUE |
DESCENDANTS |
||
NO |
YES |
||
NO |
0 |
10 |
|
YES |
1 |
11 |
The $DATA() return values can also be understood as a pair of truth-values where the left describes descendants and the right describes data where M suppresses a leading zero (representing no descendants).