fpt and WinFPT Reference Manual - Command-line Commands
| SimCon Home | Ref Manual Home |
CHANGE SELECT CASE TO IF - THEN - ELSE
Syntax:
[DO NOT] CHANGE SELECT CASE TO IF [-] THEN [-] ELSE
Function:
Systematically changes SELECT CASE constructs to IF-THEN-ELSE constructs. SELECT CASE is not supported by many Fortran 77 implementations, and differs in syntax between the Fortran 90 definition and that used by Encore Concept-32 Fortran.
Where to Use this Command
Operating system command line | Yes |
Configuration file, config.fsp | Yes |
Specification (fsp) files, *.fsp | Yes |
Interactively, to FPT> prompt | Yes |
Interactive command files | Yes |
Embedded in the Fortran code | No |
Default
SELECT CASE constructs are not changed by default (Note that defaults may be modified in the configuration file).
Examples
The code:
SELECTCASE IC0 CASE :0 WRITE(6,'('' Less than or equal to 0 '')') CASE 1:9 WRITE(6,'('' 1 to 9 '')') CASE 10 RETURN CASE DEFAULT WRITE(6, 1 '('' Default - greater than or equal to 10 '')') ENDSELECT
becomes:
! SELECTCASE IC0 ! CASE:0 IF (IC0 .LE. 0) THEN WRITE (6,'('' Less than or equal to 0 '')') ! CASE 1:9 ELSEIF ((IC0 .GE. 1) .AND. 1 (IC0 .LE. 9)) THEN WRITE (6,'('' 1 to 9 '')') ! CASE 10 ELSEIF (IC0 .EQ. 10) THEN RETURN ! CASE DEFAULT ELSE WRITE (6, 1 '('' Default - greater than or equal to 10 '')') ! ENDSELECT ENDIF
Copyright ©1995 to 2024 Software Validation Ltd. All rights reserved.