do select numeric-expression (as alias)? ((case selector (| selector)* local-scope)+ (else local-scope)? done
do select evaluates its ~numeric-expression~ argument, compares it against the numeric values or
ranges in the
case alternatives, then selects the alternative that applies. It is an error to have
more than one
case alternative apply to the same value.
If a clause was selected, the actions in that clause are performed. Otherwise, none of the actions are performed.
The numeric ranges are inclusive. If the value falls between the upper and lower bounds, or matches either
bound, the test succeeds and that
case alternative is selected.
It is an error for a selecting value to match more than one
case alternative. Each range set in
do select must describe a set of values separate from those in all the other range sets.
The following example shows how
do select is used to evaluate a numeric expression, and then
compare that expression against the numeric values or ranges in the
case alternative, in order to
select the alternative that applies. If none of the
case alternatives apply and there is
else clause, then the
else is selected.