Next: Example Of SELECT CASE
Up: Control Flow
Previous: Scope of DO Variables
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: Example Of SELECT CASE
Up: Control Flow
Previous: Scope of DO Variables
Adam Marshall ©University of Liverpool, 1996
Fri Dec 6 18:56:08 GMT 1996Not for commercial use.