blob: 52f17d05bbb31bb72247166af7d42391f4f08f67 (
plain)
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
|
{ Old file: tbs0236.pp }
{ Problem with range check of subsets !! compile with -Cr OK 0.99.11 (PFV) }
{$R+}
program test_set_subrange;
uses
erroru;
type
enum = (zero,one,two,three);
sub_enum = one..three;
prec = ^trec;
trec = record
dummy : longint;
en : enum;
next : prec;
end;
const
str : array[sub_enum] of string = ('one','two','three');
procedure test;
var hp : prec;
t : sub_enum;
begin
new(hp);
hp^.en:=zero;
new(hp^.next);
hp^.next^.en:=three;
t:=hp^.en;
Writeln('hp^.en = ',str[hp^.en]);
Writeln('hp^.next^.en = ',str[hp^.next^.en]);
end;
begin
require_error(201);
test;
end.
|