FPT and WinFPT Reference Manual - Command-line Commands

| SimCon Home | Reference 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).

Example:

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 2014 Software Validation Ltd. All rights reserved.