fpt and WinFPT Reference Manual - Command-line Commands
| SimCon Home | Ref Manual Home |
REPRESENT TRUE BY ...
Syntax:
REPRESENT TRUE BY LEAST SIGNIFICANT BIT
REPRESENT TRUE BY LSB
REPRESENT TRUE BY SIGN BIT
Function:
The command CORRECT USE OF INTEGER FOR LOGICAL instructs fpt to change instances of integer variables which are used to control logical IF statements. The integer variables are expanded to 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 | No |
Default
REPRESENT TRUE BY LEAST SIGNIFICANT BIT
(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:
1: 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))
2: When REPRESENT TRUE BY SIGN BIT is selected:
STATUS=LIB$GET_LUN(ICH) IF (.NOT. (STATUS .LT. 0)) CALL LIB$SIGNAL(%VAL(STATUS))
See Also
CHECK DATA TYPE COERCION
CORRECT USE OF INTEGER FOR LOGICAL
Copyright ©1995 to 2025 Software Validation Ltd. All rights reserved.