FPT and WinFPT Reference Manual - Command-line Commands

| SimCon Home | Reference Manual Home |


CORRECT USE OF INTEGER FOR LOGICAL

Syntax:

[DO NOT] CORRECT USE [OF] INTEGER FOR LOGICAL

Function:

FPT searches the code for instances of integer variables which are used to control logical IF statements. This is often encountered when code is migrated from VMS. The integers are replaced by logical expressions. The way in which the statements are modified depends on the commands:

REPRESENT TRUE BY LEAST SIGNIFICANT BIT

or

REPRESENT TRUE BY SIGN BIT

as shown in the examples below.

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 correction is made by default (Note that defaults may be changed in the configuration file).

Examples:

The code:

STATUS=LIB$GET_LUN(ICH) IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))

where STATUS is an integer variable, is corrected:

when REPRESENT TRUE BY LEAST SIGNIFICANT BIT is selected:

STATUS=LIB$GET_LUN(ICH) IF (.NOT. (IAND(STATUS,1) .NE. 0)) CALL LIB$SIGNAL(%VAL(STATUS))

when REPRESENT TRUE BY SIGN BIT is selected:

STATUS=LIB$GET_LUN(ICH) IF (.NOT. (STATUS .LT. 0)) CALL LIB$SIGNAL(%VAL(STATUS))


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