Intel® Fortran Compiler 16.0 User and Reference Guide

SELECT CASE and END SELECT

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

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