fpt and WinFPT Reference Manual - Command-line Commands

| SimCon Home | Ref Manual Home |

ENCAPSULATE READ ACCESS TO INTEGER*1 OBJECTS

Syntax:

[DO NOT] ENCAPSULATE READ [ACCESS] [TO] INTEGER [*] 1 [OBJECTS] [DO NOT] ENCAPSULATE READS [OF] BYTE [OBJECTS]

Function:

All read accesses to INTEGER*1 objects are enclosed in the function fpt_access_i1. On some systems, in particular, Gould-SEL (Encore) extended Fortran 77, the INTEGER*1 data type is unsigned. On these systems, whenever an INTEGER*1 variable is used in an arithmetic expression or as an array index it has a positive value in the range 0:255. This could cause serious problems in migration from Gould-SEL systems to standard Fortran. The function fpt_access_i1 returns an INTEGER*4 value which is equal to the unsigned INTEGER*1 value.

Note that INTEGER*1 objects are not encapsulated when they are passed as arguments to sub-programs. The encapsulation is made, where appropriate, in the sub-program.

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

Examples

The code fragment:

INTEGER*1 I1,I0 REAL*8 RSUM(3),R(2,3) : K=256*I1+I0 : RSUM(I1)=R(1,I1)+R(2,I1) : CALL S(I1)

is changed by the command:

% encapsulate read access to integer*1

to:

INTEGER*4 fpt_access_i1 INTEGER*1 i1,i0 REAL*8 rsum(3),r(2,3) : k=256*fpt_access_i1(i1)+fpt_access_i1(i0) !--------------------------^-----------------^--------------------------------- ! fpt - 3305 Read access encapsulated ! fpt - 3305 Read access encapsulated !------------------------------------------------------------------------------ : rsum(fpt_access_i1(i1))=r(1,fpt_access_i1(i1))+r(2, & !-------------------------^----------------------^----------------------------- ! fpt - 3305 Read access encapsulated ! fpt - 3305 Read access encapsulated !------------------------------------------------------------------------------ fpt_access_i1(i1)) !---------------------^-------------------------------------------------------- ! fpt - 3305 Read access encapsulated !------------------------------------------------------------------------------ : CALL s(i1)

Note that i1 is not encapsulated in the call to S().

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