OpenSTA logo OpenSTA SCL Reference
IF Command

IF Command

This command performs tests on the values of variables against other variables or literals, and transfers control to a specified label depending upon the outcome of the tests.

Alternatively, structured IF commands may be used to perform one or more commands depending upon the success or failure of the tests.

By default, the matching is case sensitive. The strings "London" and "LONDON", for example, would not produce a match, because the case of the characters is not the same. This can be overridden by specifying the , CASE_BLIND clause.

Command Definition:

IF condition GOTO label

IF condition THEN commands{s}
	{ELSEIF condition THEN command{s}}
	{ELSEIF condition THEN command{s}}
	{ELSE command{s}}
ENDIF

condition

A condition of the following format:

{NOT}(operand1 operator operand2 {, CASE_BLIND})
	{AND/OR condition ...}

The two operands may each be a variable, a quoted character string or an integer value.

The option CASE_BLIND may be specified for operand2, to request a case-insensitive comparison of the operands.

NOT inverts the result of the bracketed condition that it precedes.

The binary operators are:

operatormeaning
=operand1 equals operand2
<>operand1 does not equal operand2
<operand1 is less than operand2
<=operand1 is less than or equal to operand2
>operand1 is greater than operand2
>=operand1 is greater than or equal to operand2
^operand1 contains operand2
CONTAINSoperand1 contains operand2
<^>operand1 does not contain operand2
NOT CONTAINSoperand1 does not contain operand2
NOT_CONTAINSoperand1 does not contain operand2

All conditions are evaluated from left to right.

label

A label defined in the current scope of the Script.

command

Any number of Script commands - including further IF or DO commands, provided that the maximum nesting level of 100 is not exceeded.

Example:

IF (NOT(isub=10) AND (NOT(isub=99))) THEN
	LOG "...continued"
ELSE
	LOG "Completed loop"
ENDIF

<<<
prev page
^^^
section start
>>>
next page