The IF Statement
Syntax
Format
IFcondition-1 THEN
{ statement-1
NEXT SENTENCE }
[ELSE
{ statement-1
NEXT SENTENCE }]
[END-IF]
Description
The IF statement is used to test various conditions. The ELSE clause is used to provide code to be executed for the alternative condition. When the statement is executed, the condition after IF is evaluated. If the condition is true, the statement(s) between the condition and the ELSE clause are executed and control is then transferred to the statement following the END-IF. If the condition is false, the code between the ELSE and the END-IF, if any, is executed.
Tips
1. The IF statement can be used to test for various kinds of conditions, relational tests, class tests, sign tests, or condition name tests. See conditions for more detail.
2. The logical operators AND, OR, and NOT may be used to combine conditions into complex conditions. If these operators are used, the order of precedence is from highest to lowest: AND, OR, and finally NOT, unless the order is overridden with the use of parentheses.
Posted by
KK
at
5:21 AM