SELECT CASE...END SELECT

Statement: Transfers program control to a selected block of statements according to the value of a controlling expression. CASE.

Example

CHARACTER*1 cmdchar

. . .

Files: SELECT CASE (cmdchar)

CASE ('0')

WRITE (*, *) "Must retrieve one to nine files"

CASE ('1':'9')

CALL RetrieveNumFiles (cmdchar)

CASE ('A', 'a')

CALL AddEntry

CASE ('D', 'd')

CALL DeleteEntry

CASE ('H', 'h')

CALL Help

CASE DEFAULT

WRITE (*, *) "Command not recognized; please re-enter"

END SELECT Files