FPT and WinFPT Reference Manual - Command-line Commands

| SimCon Home | Reference 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 ERROR 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 2014 Software Validation Ltd. All rights reserved.