$passnum

Purpose

Fetch the current pass number that code is being executed in.

Syntax

returnedString = variableType("$passnum")

returnedString - type: integer
variableType - type: G
 

Returns

Current pass number that the parser is executing in.

Remarks

 With $rulenum, yields the pass and rule number.  NOTE that when executing in a function outside a rule context, $passnum indicates the pass that the function was DEFINED IN.  (This behavior will be fixed in a future version with the addition of another variable called something like $codepass.)

Example

@POST

# Print current pass number and rule number.

"output.txt" <<  G("$passnum") << ", " << G("$rulenum") << "\n";

@RULES

_xNIL <- _clause @@

 

When this rule matches, output.txt contains lines such as

33, 1

See Also

$rulenum, Special Variables