Go to the first, previous, next, last section, table of contents.

CASE Statement

The case statement is a specialization of the IF/THEN/ELSIF statement that allows discrimination among a set of possible values of some ordinal expression expr. If a case is encountered that is not handled by one of the arms of the case statement, the ELSE arm is taken; if no ELSE arm is present in this situation, a checked run-time error occurs.

The compiler will generate a warning if no ELSE arm appears and not all cases are covered. This can be ignored at risk of a possible runtime error, or an empty ELSE arm can be inserted to pacify the compiler and runtime system.


Example


Go to the first, previous, next, last section, table of contents.