Function
When a complex condition is written without parentheses, any relation condition except the first may be abbreviated as follows:
the subject of the relation condition may be omitted.
the subject and relational operator of the relation condition may be omitted.
However, the compiler permits the use of parentheses in relation subjects and relation objects which are arithmetic expressions, and in order to affect the sequence in which the logical operators AND and OR are evaluated.
Format of implied subject
...subject relational-operator object {AND | OR} [NOT] relational-operator object...
Format of implied subject and relational operator
...subject relational-operator object {AND | OR} [NOT] object...
Syntax rules
Within a sequence of relation conditions, both forms of abbreviation may be used. The effect of using such abbreviations is the same as if the omitted subject were replaced by the most recently stated subject, or the omitted relational-operator were replaced by the most recently stated relational-operator.
NOT in an abbreviated complex condition is interpreted as follows:
If the word NOT is followed by one of the relational operators
GREATER, >, LESS, <, EQUAL, =,
then NOT is considered as part of the relevant relational operator.If the word NOT is followed by one of the other relational operators, then NOT is considered as a logical operator to negate the relevant relation condition.
A NOT appearing in front of a left parenthesis remains in effect up to the associated right parenthesis (see "Example 8-15").
Example 8-11
Implied subjects
IF X = Y OR > W OR < Z
is equivalent to
IF X = Y OR X > W OR X < Z
In this example, the implied subject is the most recently stated subject, i.e. X.
Example 8-12
Implied subjects and relational operators
IF X = Y OR Z OR W
is equivalent to
IF X = Y OR X = Z OR X = W
In this example, the implied subject is the most recently stated subject, i.e. X; and the implied relational operator is the most recently stated operator, i.e. =.
Example 8-13
Implied subject, and implied subject with relational operator
X = Y AND > Z OR A
is equivalent to
X = Y AND X > Z OR X > A
Here, since X is the only stated subject, it is substituted in both simple conditions. The most recently stated operator, >, is substituted in the third simple condition.
Example 8-14
A > B AND NOT > C OR D
is equivalent to
A > B AND NOT A > C OR NOT A > D
or
((A > B) AND (A NOT > C)) OR (A NOT > D)
Example 8-15
A NOT = "A" AND NOT ("B" OR NOT "C")
is equivalent to
A NOT = "A" AND NOT (A NOT = "B" OR NOT A NOT = "C")
or
A NOT = "A" AND A = "B" AND A NOT = "C"
or
A = "B"
.