Next: FOR Statement, Previous: CASE Statement, Up: Statements [Contents][Index]
The ncase
statement selects one of a set of statements for
execution, depending on a single control value.
NCASE expr statement1 [ statement2 … ] [ ELSE statement ] ENDCASE
The control expression expr
is evaluated. It must have a
scalar value, and the integer part of this value is then used as control
value. If the control value is zero, one, etcetera, then the first,
second, etcetera, statement statement1
,
statement2
, etcetera, is executed. If there is no
statement corresponding to the control value, then the else
statement statement
is executed, if an else
part was
specified. Otherwise, this ncase
statement does nothing and
control passes directly to the next one.