do select numeric-expression ((case selector (| selector)* local-scope)+ (else local-scope)? done
Evaluates a numeric expression, 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 part was selected, the actions in that part 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 a
do select must describe a set of values separate from those in all the other range sets. This provision provides error detection, avoids "what happens when" questions, and allows for optimization.
This code sample 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.