Simulation Command Reference : Rational Statemate Actions : WHEN

WHEN

The WHEN statement is used for conditional execution of SCL statements depending on event occurrence.

Syntax:
when trigger then
statement [ ; statement . . . ]
[else
statement [ ; statement . . . ]
]
end when

where trigger is any event expression and statement is any SCL statement

The WHEN/THEN/ELSE structured statement is used to execute SCL statements when a particular event occurs. The statements following THEN and before ELSE are executed if the trigger is true. If the trigger is false, the statements between ELSE and END are executed.

Example:
WHEN tr(c) THEN
err := err + 1;
ELSE
WRITE (“Error Encountered”)
END WHEN