home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.ee.pdx.edu
/
2014.02.ftp.ee.pdx.edu.tar
/
ftp.ee.pdx.edu
/
pub
/
users
/
Harry
/
compilers
/
p10
/
tst
/
record.pcat
< prev
next >
Wrap
Text File
|
2006-02-17
|
1KB
|
45 lines
(* This program tests whether offsets are being assigned in records. *)
program is
var i: integer := 0;
x: real := 0.0;
b: boolean := false;
procedure foo (a1,a2,a3: integer) is
var r: MyRec1 := nil;
type MyRec1 is record
f1: integer;
f2: real;
f3: boolean;
f4: MyRec3;
end;
MyRec2 is record
h1: integer;
h2: real;
h3: boolean;
end;
MyRec3 is record
g1: integer;
g2: real;
g3: boolean;
g4: MyRec2;
end;
begin
i := i + 3;
r := r;
i := r.f1;
x := r.f2;
b := r.f3;
x := r.f4.g2;
x := r.f4.g4.h2;
r.f1 := i;
r.f2 := x;
r.f3 := b;
r.f4.g2 := x;
r.f4.g4.h2 := x;
return;
end;
begin end;