FPT and WinFPT Reference Manual - Command-line Commands

| SimCon Home | Reference 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 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 C% 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', 1 STATUS='OLD')

is translated by the command:

% insert subroutine to translate file names

to read:

CALL VXRMS_TRANSLATE_FILE_NAME( 1 'DKA400:[TESTSUITE.DATA2]TRAJ.DAT', 1 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*(*) 1 FILESP ! Record file 1 , TARG ! Record to be found !% FILE NAME :: FILESP INTEGER*4 1 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', 1 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 2014 Software Validation Ltd. All rights reserved.