Installation guide

114 Programming Commands
IF...THEN...ELSE IF... Program Flow Command
ELSE...END IF
ACTION: Allows conditional execution based on the evaluation of a Boolean con-
dition.
PROGRAM SYNTAX 1: IF condition THEN thenpart [ELSE elsepart]
PROGRAM SYNTAX 2: IF condition THEN
statement block 1
[ELSE IF condition THEN] ELSE IF and statement block 2
are optional
statement block 2
[ELSE] ELSE and statement block 3
are optional
statement block 3
END IF
REMARKS: The argument condition is an expression that is evaluated as true
(nonzero) or false (zero).
The argument statement block includes any number of statements on
one or more lines.
The argument thenpart includes the statement or branches performed
when the condition is true.
The argument elsepart includes the statement or branch performed
when the condition is false. If the ELSE IF or ELSE clause is not pres-
ent, control passes to the next statement in the program following the
END IF.
EXAMPLES: Start:
IF BCD(101)=0 THEN
GOTO program0
ELSE IF BCD(101)=1 THEN
GOTO program1
ELSE IF BCD(101)=2 THEN
GOTO program2
ELSE
GOTO Start
END IF
program0:
statements
END
program1:
statements
END
program2:
statements
END