case statement selects one of a set of statements for
execution, depending on a set of conditions.
CASE expr1 : statement1 [ expr2 : statement2 … ] [ ELSE statement ] ENDCASE
The condition expressions
expr2, and so
on are evaluated in turn until the first non-zero value (i.e., true
condition) is found. Then, the corresponding statement
statement2, etcetera, is
executed. If none of the conditions evaluates to a non-zero value, then
statement is executed, if an
else part was specified. Otherwise, this
does nothing and control passes directly to the next statement.
All evaluated conditions must have scalar values.