% IF condition1 statementblock % ELSE-IF condition2 statementblock % ELSE-IF conditionN statementblock % ELSE statementblock [% END]
condition | Can be a
Numbers, literals, and variables must be followed by a space and a relational operator; followed by a space and a value. To specify multiple conditions, use the Boolean operators AND or OR with no parentheses. |
Test a variable for a numeric condition.
% IF &LEN = 80 % IF &APS-INDENT < 8
Test a variable for a true condition, represented by the value 1.
% &EMPLOYEE-TYPE-A = 0 % &EMPLOYEE-TYPE-B = 1 % IF &EMPLOYEE-TYPE-B statementblock
Test a variable for multiple conditions.
% IF &APS-INDENT < 8 OR &APS-INDENT > 11
Code an ELSE ... IF rather than ELSE-IF.
% ELSE % IF &A = "ABC" OR &B = "DEF"
Nest conditional statements.
% IF condition1 statementblock1 % IF condition2 % IF condition3 statementblock2 % ELSE-IF condition4 % ELSE-IF condition5 statementblock3 % ELSE statementblock4 % ELSE statementblock5 % IF condition6 % IF condition7 statementblock6 statementblock7
Comments: