once(bool Condition): int

Helper function; returns nonzero when Condition became true the first time in a session or simulation cycle, otherwise 0.

Parameters:

Condition - any boolean expression.

Returns:

Nonzero when Condition just became true, otherwise 0.

Example:

if(once(!is(LOOKBACK))) printf("\nEnd of lookback reached!");

See also:

if, ifelse

► latest version online