Simulation Command Reference : Rational Statemate Actions : IF

IF

The IF statement is used to perform a conditional execution of SCL statements.

Syntax:
if condition then
statement [ ; statement . . . ]
[else
statement [ ; statement . . . ]
]
end if
where condition is any expression returning a Boolean value and statement is any SCL statement
The IF/THEN/ELSE structured statement is used to execute SCL statements conditionally. The statements following THEN and before ELSE are executed if condition is true. If condition is false, the statements between ELSE and END are executed.
Example:
IF a > b THEN
err := err + 1 ;
ELSE
WRITE (‘a is less than b’)
END IF