TAL Reference Manual

Statements
TAL Reference Manual526371-001
12-13
Unlabeled CASE Statement
213, 818 ->
location := los_angeles;
808 ->
location := hawaii;
OTHERWISE ->
location := elsewhere;
END; !End CASE statement
END; !End AREA_PROC
Unlabeled CASE Statement
The unlabeled CASE statement executes a choice of statements, based on an
inclusive range of implicit selector values, from 0 through
n, with one statement for
each value.
selector
is an INT arithmetic expression that selects the statement to execute.
statement
is any statement described in this section. Include a statement for each value in the
implicit
selector range, from 0 through n. If a selector has no action, specify a null
statement (semicolon with no statement). If you include more than one
statement
for a value, you must use a compound statement.
OTHERWISE
indicates the statement to execute for any case outside the range of selector
values. If the OTHERWISE clause consists of a null statement, control passes to
the statement following the unlabeled CASE statement. See Omitted Otherwise
Clause.
Usage Considerations
The compiler numbers each statement in the BEGIN clause consecutively, starting with
0. If the
selector matches the compiler-assigned number of a statement, that statement
is executed. For example, if the
selector is 0, the first statement executes; if the
;
CASE
selector OF BEGIN
END
OTHERWISE ;
statement
statement
VST1209.vsd