fpt and WinFPT Reference Manual - Command-line Commands

| SimCon Home | Ref Manual Home |

INSERT SUBROUTINE TO TRANSLATE FILE NAMES

Syntax:

INSERT SUBROUTINE TO TRANSLATE FILE NAMES

Function:

Code is constructed to translate the file names in every OPEN and INQUIRE statement and in calls to every sub-program which accepts a file name as an input argument. The translation is carried out by calling a translation subroutine.

The name of the subroutine may be specified by the command TRANSLATION SUBROUTINE FOR FILE NAMES. If no subroutine is specified, the Sector7 routine in VX/Tools, vxrms_translate_file_name, is used. The arguments are:

  1. The file name to be translated, CHARACTER*(*), INTENT (IN)
  2. The translated name, CHARACTER*(*), INTENT (OUT)
  3. A status return, INTEGER*4, INTENT (OUT)

Declarations for the translated file name, and for the status return variable, are inserted wherever they are required.

An argument to a sub-program is declared to be a file name by writing the command !% FILE NAME :: <argument> in the code, within the scope of declaration of the named argument.

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

No translation is inserted by default.

Examples:

A file name in an OPEN statement, for example:

OPEN (4,FILE='DKA400:[TESTSUITE.DATA2]TRAJ.DAT', & STATUS='OLD')

is translated by the command:

% insert subroutine to translate file names

to read:

CALL vxrms_translate_file_name( & 'DKA400:[TESTSUITE.DATA2]TRAJ.DAT', & translated_file_name,tfn_status) OPEN (4,FILE=translated_file_name,STATUS='OLD')

An argument to a sub-program may be declared to be a file name, for example:

SUBROUTINE FINDREC(FILESP,TARG,RECNO) CHARACTER)LEN=*) :: FILESP ! Record file CHARACTER(LEN=*) :: TARG ! Record to be found !% FILE NAME :: FILESP INTEGER(ki4) :: RECNO ! Record number returned

and an invocation:

CALL FINDREC('DBASE:SUBJECTS.DAT',SEARCHNAME,IREC)

is then modified:

CALL VXRMS_TRANSLATE_FILE_NAME('DBASE:SUBJECTS.DAT', & TRANSLATED_FILE_NAME,TFN_STATUS) CALL FINDREC(TRANSLATED_FILE_NAME,SEARCHNAME,IREC)

See Also

FILE NAME

INSERT FUNCTION TO TRANSLATE FILE NAMES

TRANSLATION FUNCTION FOR FILE NAMES

TRANSLATION SUBROUTINE FOR FILE NAMES

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