IF

Use

IF ( <condition> ).

This command starts an IF control structure. The system evaluates the logical expression <condition>, and processes different statement blocks depending on the result. A statement block ends with either ELSEIF, ELSE, or ENDIF. You can nest IF control structures.

ELSEIF and ELSE are optional.

The last statement block is always terminated by ENDIF.

IF ( <condition1> ).

<statement block1>

ELSEIF ( <condition2> ).

<statement block2>

ELSEIF ( <condition3> ).

<statement block3>

.....

ELSE.

<statement block4>

ENDIF.

If the IF condition is true, eCATT executes all the statements up to the end of the following statement block and then continues processing after the ENDIF statement.

If the IF condition is not true, the following statement block is ignored. In this case, the following ELSEIF condition is evaluated. ELSEIF is executed in the same manner as IF.

ELSE begins a statement block which is processed if none of the IF or ELSEIF conditions are true.

Conditions

To formulate conditions, you can use logical expressions containing the following operators:

Operator

Meaning

=

equal to

<>

not equal to

<

less than

<=

less than or equal to

>

greater than

>=

greater than or equal to

Simple conditions have the form:

 <parameter1> <comparison operator> <parameter2>

You can build complex expressions using the following boolean operators:

Operator

Meaning

AND

Boolean AND

OR

Boolean OR

NOT

Boolean NOT

For the complex logical expression to be true:

·        Only if all of the component expressions are true, link the expressions with AND.

·        If at least one of the component expressions is true, link the expressions with OR.

To negate the result of a logical expression, you can precede it with the NOT operator.

NOT takes priority over AND. AND takes priority over OR. However, you can use parentheses to specify the processing sequence.

If your expressions contain values other than strictly numerical ones, only the comparisons using = or <> will give reasonable results.

Because there is no data type representing boolean values, you do not get reasonable results from expressions such as <parameter1> AND <parameter2> or <parameter1> OR <parameter2>. The same is true for NOT <parameter2>.

Leave a space before and after a parenthesis.

Example

IF ( NOT ( A < B AND A > D ) ).

LOG ( A ).

ENDIF.