Chapter 4-2: True/False Status Indicators Cover Page Adding Execution ConditionsAND and OR with Statements Other Than IF

Potential Misuse of AND and OR


We can modify the previous example slightly to point out a potential misuse of an IF/AND statement combination:

          IF       TAR CUSTOMER BALANCE           GT     0
    T     AND      TAR WORK ON ACCOUNT AMOUNT     NE     0

If the IF statement is true, the IF statement sets the level 1 internal true/false status indicator to T and the AND statement executes. But the AND attempts to modify the level 2 internal true/false status indicator, which has not been set. This generates a runtime error. A similar problem would result for an IF/OR statement combination with mismatching execution conditions.

In general, AND and OR statements should be subject to the same execution conditions as the statement they qualify (that is, the statement which originally sets the internal status indicator).

 

APPX Application Design Manual (01/13/03) Cover Page Adding Execution ConditionsAND and OR with Statements Other Than IF

© 2003 by APPX Software, Inc. All rights reserved