HP Pascal/iX Reference Manual (31502-90022)

6-: 6
Note that statements between OTHERWISE and END need not be bracketed with
BEGIN..END.
When the system executes a CASE statement, the following occurs:
1. It evaluates the selector.
2. If the value corresponds to a specified case constant, it executes
the statement associated with that constant. Control then passes
to the statement following the CASE statement.
3. If the value does not correspond to a specified case constant, it
executes the statements between OTHERWISE and END. Control then
passes to the statement after the CASE statement. The OTHERWISE
clause must be present or the selector must match any CASE label.
Syntax
Example
PROCEDURE scanner;
BEGIN
get_next_char;
CASE current_char OF
'a'..'z', { Subrange CASE label }
'A'..'Z':
scan_word;
'0'..'9':
scan_number;
OTHERWISE scan_special;