|
|
The "case" statement consists of an expression (the selector) and a list of statements, each prefixed with a case. Sintax: case expression of case: statement; ... case: statement; end; or case expression of case: statement; ... case: statement; else statement; end; A case consists of one or more constants or ranges, separated with commas. The "else" part is optional. Example:case Ch of
'A'..'Z',
'a'..'z': WriteLn('Letter');
'0'..'9': WriteLn('Digit');
'+', '-',
'*', '/': WriteLn('Operator');
else WriteLn('Special character');
end; |
|