FPT and WinFPT Reference Manual - Command-line Commands

| SimCon Home | Reference Manual Home |


CORRECT INCONSISTENT STRING ARGUMENTS TO ...

Syntax:

CORRECT [INCONSISTENT] STRING ARGUMENTS { TO | BY } { HOLLERITHS | %REF }

Function:

Early versions of Fortran did not support character variables. Character strings were manipulated and passed to sub-programs in numeric variables. For example:

SUBROUTINE DLABEL(DNAME,DVAL) DOUBLE PRECISION DNAME,DVAL WRITE (6,100)DNAME,DVAL 100 FORMAT (A8,F14.5) RETURN END PROGRAM MAIN : DOUBLE PRECISION V : CALL DLABEL(8HVelocity, V) :

Some Fortran systems allow string literals to be passed in the same way as the Hollerith literal used above, for example:

CALL DLABEL ( 'Velocity', V)

Some compilers and linkers do not support this usage. The difficulty is that the literal string is passed as a descriptor or by address and length, but the double precision number is usually passed by reference, i.e. by address only. The code may be corrected in two ways:

  1. The string may be converted to an Hollerith literal.

  2. The string may be passed by reference, rather than by descriptor, using the pseudo-function %REF.

FPT may be instructed to use either mechanism by the commands:

CORRECT INCONSISTENT STRING ARGUMENTS TO HOLLERITHS

CORRECT INCONSISTENT STRING ARGUMENTS TO %REF

Please note that neither of these strategies conforms to the Fortran 95 standard.

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:

CORRECT INCONSISTENT ARGUMENTS TO HOLLERITHS

(Note that defaults may be changed in the configuration file)

See also:

CORRECT INCONSISTENT ARGUMENTS


Copyright ©1995 to 2014 Software Validation Ltd. All rights reserved.