fpt and WinFPT Reference Manual - Command-line Commands
| SimCon Home | Ref Manual Home |
REMOVE EMBEDDED EXPRESSIONS FROM FORMATS
Syntax:
[DO NOT] REMOVE EMBEDDED EXPRESSIONS FROM FORMATS
[DO NOT] REMOVE EMBEDDED EXPRESSIONS FROM FORMAT SPECIFICATIONS
Function:
Some compilers support embedded integer expressions written in FORMAT specifications, delimited by < and > characters, for example:
WRITE(4,8010)(A(I),I=1,8) 8010 FORMAT(8F<IW>.<IX>) WRITE(2,'(4X,1E<8+J>.8)')
This usage is non-standard, and is unsupported, or supported with different limitations in some environments.
The command REMOVE EMBEDDED EXPRESSIONS FROM FORMATS modifies the code to use run-time formats which conform to the Fortran 77 and Fortran 90 standards. The statements above are modified to read:
! fpt WRITE (4,8010)(A(I),I-1,8) WRITE (EMBEDDED_EXPRESSIONS(1),'(1I10)')IW WRITE (EMBEDDED_EXPRESSIONS(2),'(1I10)')IX WRITE (4,'(8F'//EMBEDDED_EXPRESSIONS(1)//'.'// !-------------------------------------------^------------------------- fpt - 1819 Embedded expression of the form <...> has been removed !--------------------------------------------------------------------- 1 EMBEDDED_EXPRESSIONS(2)//')')(A(I),I-1,8) !-----------------------------^--------------------------------------- fpt - 1819 Embedded expression of the form <...> has been removed !--------------------------------------------------------------------- ! fpt 8010 FORMAT (8F<IW>.<IX>) ! fpt WRITE (2,'(4X,1E<8+J>.8)') WRITE (EMBEDDED_EXPRESSIONS(1),'(1I10)')8+J WRITE (2,'(4X,1E'//EMBEDDED_EXPRESSIONS(1)//'.8)') !----------------------------------------------^---------------------- fpt - 1819 Embedded expression of the form <...> has been removed !---------------------------------------------------------------------
The CHARACTER*10 array EMBEDDED_EXPRESSIONS, which holds the text of the numeric values originally enclosed in < > delimiters, is declared in the INCLUDE file embedded_expression_cmn.fpi, which is included wherever it is needed. The bounds of this array are adjusted to accommodate the largest number of embedded expressions which occur in a single I/O statement.
The change to the code is marked by a diagnostic. This may be removed by specifying SUPPRESS DIAGNOSTIC 1819.
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 | Yes |
Default
Embedded expressions are retained by default.
Copyright ©1995 to 2025 Software Validation Ltd. All rights reserved.