
Selection 81
case press stat of
value ’D’: msg = "Very dangerous"
value ’A’: msg = "Alert"
value ’W’: msg = "Warning"
value ’N’: msg = "Normal"
value ’B’: msg = "Below normal"
endcase
display "Pressure status: ", msg
The default option of the case statement can also be used by writing the key-
words default or otherwise in the last case of the selector variable. For example,
the previous example can be enhanced by including the default option in the case
statement:
case press stat of
value ’E’: msg = "Very dangerous"
value ’D’: msg = "Alert"
value ’H’: msg = "Warning"
value ’N’: msg = "Normal"
value ’B’: msg = "Below normal"
otherwise
msg = "Pressure rising"
endcase ...