
218 Chapter 3
Command Deļ¬nitions C-E
ELSEIF
ELSEIF
Provides an alternate execution sequence within an IF statement. Native Mode
Syntax
ELSEIF expression [ THEN]
Parameters
expression Logical expression, consisting of operands and relational operators. The
THEN keyword is optional. It may be used or omitted and has no effect on
the results. The operators listed in Table 3-8 may be incorporated in
expression.
Table 3-8 Logical Operators - The ELSEIF Command
Operation Notes
The ELSEIF command is used only in conjunction with the IF command. The ELSEIF
command provides a way of avoiding nested IF statements. ELSEIF has meaning only
when used after an IF construct.
Any number of ELSEIF commands may follow an IF command. In contrast, only one ELSE
command may follow an IF or ELSEIF command. Refer to the ELSE and IF commands.
Use
This command may be issued from a session, job, program, or in BREAK. Pressing Break
has no effect unless expression contains the INPUT evaluator function.
Logical operators: AND, OR, XOR, NOT
Boolean functions and values: BOUND, TRUE, FALSE, ALPHA, ALPHANUM, NUMERIC,
ODD
Comparison operators: =, <>, <, >, <=, >=
Bit manipulation operators: LSL, LSR, CSR, CSL, BAND, BOR, BXOR, BNOT
Arithmetic operators: MOD, ABS, * , / , + , -, ^ (exponentiation)
Functions returning strings: CHR, DWNS, UPS, HEX, OCTAL, INPUT, LFT, RHT, RPT,
LTRIM, RTRIM, STR
Functions returning integers: ABS, LEN, MAX, MIN, ORD, POS, TYPEOF
Other functions: FINFO, SETVAR