fpt and WinFPT Reference Manual - Command-line Commands

| SimCon Home | Ref Manual Home |

INSERT TRANSLATIONS OF FOREIGN OBJECTS

Syntax:

[DO NOT] INSERT TRANSLATION[S] OF FOREIGN OBJECTS

Function:

This command is used to handle numbers in formats which are foreign to the current host, for example, where Gould-SEL real numbers are read from external hardware by a Unix host which uses IEEE numbers.

Foreign numbers are specified in the code or in template (ftm) files by commands of the form, for example:

!% INSERT REAL*4 FUNCTION S2IEEE TO TRANSLATE READ ACCESS TO VS

If foreign translations are inserted in this case, every read access to VS will be modified to use the function S2IEEE to reformat the number. The commands [DO NOT] INSERT TRANSLATIONS OF FOREIGN OBJECTS control whether or not the translations are inserted.

Default

Foreign translations are inserted by default. Therefore, to suppress translation, it is necessary to specify DO NOT INSERT TRANSLATIONS OF FOREIGN OBJECTS in the specification file or on the operating system command line.

Where to Use this Command

Operating system command line Yes
Configuration file, config.fsp Yes
Specification (fsp) files, *.fsp Yes
Interactively, to FPT> prompt No
Interactive command files No
Embedded in the Fortran code No

Examples

The code of a template (ftm) file contains the declarations:

REAL*4 TV,VS2(128) !% INSERT REAL FUNCTION S2IEEE TO TRANSLATE READ ACCESS TO VS2 !% INSERT REAL FUNCTION IEEE2S TO TRANSLATE WRITE ACCESS TO TV

The read access to the variable VS2:

PHI=VS2(3)

is translated:

!% TRANSLATION FUNCTION INSERTED FOR: VS2 PHI=S2IEEE(VS2(3))

TV occurs in a READ statement, and data is therefore written to it:

READ(4) TV

The statement is modified:

READ (4)TV_TMP !% TRANSLATION FUNCTION INSERTED FOR: TV TV=IEEE2S(TV_TMP)

The new variable TV_TMP is declared automatically wherever it is needed.

Note the commands !% TRANSLATION FUNCTION INSERTED... which fpt has embedded in the code. These prevent fpt from inserting a second translation if it is re-run on the code.

See Also

INSERT FUNCTION TO TRANSLATE READ ACCESS

INSERT FUNCTION TO TRANSLATE WRITE ACCESS

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