Using the Logic Editor
160
372 SPU 780 01EMAN May 2002
Conditional
Expressions
In Equation Networks, conditional expressions take the following form:
EXPR1 RELOP (EXPR2) ? (EXPR3) : EXPR4
EXPR1 through EXPR4 can be any address, value or expression. If EXPR2 or
EXPR3 are not single values or addresses, they must be enclosed in brackets.
RELOP can be any relational operator, such as > (greater than) or <> (not equal to).
When solving a conditional expression, the computer first compares EXPR1 and
EXPR2, based on the relational operator. If the comparison is true, the value of the
conditional expression is the result of EXPR3. If the comparison is false, the value
of the conditional expression is EXPR4.
Note: It is especially good programming practice to enclose all expressions within
a conditional expression in parentheses, even when they’re not actually needed.
This makes the equation easier to read and ensures that operations are solved in
the correct order.