8

The Pascal procedure,

VarRec.p

Variant Records

FORTRAN equivalents of variant records can sometimes be constructed, although there is some variation with architecture, and sometimes you need to adjust the alignment.

type vr = record case tag: char of

'a': ( ch1, ch2: char ) ;

'b': ( flag: boolean ) ;

'K': ( ALIGN: integer ) ; end ;

procedure varrec_ ( var Rec: vr ) ;

begin

if ( Rec.ch1 = 'a' ) then Rec.ch2 := 'Z'

end; { VarRec.p }

The FORTRAN–Pascal Interface

177

Page 201
Image 201
HP SunSoft Pascal 4.0 manual Variant Records, FORTRAN-Pascal Interface 177