forked from pascalabcnet/pascalabcnet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnested1.pas
48 lines (41 loc) · 835 Bytes
/
nested1.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
type Examinations = record
algebra, calculus, programming : integer;
procedure InitRan;
end;
procedure Examinations.InitRan;
function RandomMark : integer;
begin
result := 10;
end;
begin
algebra := RandomMark;
calculus := RandomMark;
programming := RandomMark;
assert(algebra=10);
assert(calculus=10);
assert(programming=10);
end;
type CExaminations = class
algebra, calculus, programming : integer;
procedure InitRan;
end;
procedure CExaminations.InitRan;
function RandomMark : integer;
begin
result := 10;
end;
begin
algebra := RandomMark;
calculus := RandomMark;
programming := RandomMark;
assert(algebra=10);
assert(calculus=10);
assert(programming=10);
end;
var rec : Examinations;
cls : CExaminations;
begin
rec.InitRan;
cls := new CExaminations;
cls.InitRan;
end.