Next: Mixing Objects of Different
Up: Control Constructs
Previous: Visualisation of SELECT CASE
This is useful if one of several paths
must be chosen based on the value of a single expression.
The syntax is as follows,
[ < name >:
] SELECT CASE (< case-expr >)
[ CASE (< case-selector >) [ < name > ]
< exec-stmts > ] ...
[ CASE DEFAULT [ < name > ]
< exec-stmts > ]
END SELECT [ < name > ]
Note,
- the < case-expr > must be scalar and INTEGER, LOGICAL
or CHARACTER valued;
- the < case-selector > is a parenthesised single value or
range, for example, (.TRUE.), (1) or (99:101);
- there can only be one CASE DEFAULT branch;
- control cannot jump into a CASE construct.
For more information, click here
Next: Mixing Objects of Different
Up: Control Constructs
Previous: Visualisation of SELECT CASE
©University of Liverpool, 1997
Wed May 28 23:37:18 BST 1997Not for commercial use.