blob: 75f6935d0d2f2d89a7f5bcad0b61c8bde82ead10 (
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
|
{$mode objfpc}
program testlist;
uses
Sysutils,
Classes;
var
l: TList;
IsCaught: boolean;
begin
L:= TList.Create;
IsCaught:=false;
Try
WriteLn(LongInt(L[0]));{L[0] not exist, ==> access violation}
L.Free;
Except
on eListError do
IsCaught:=true;
end;
If not IsCaught then
begin
Writeln('Error in TList');
Halt(1);
end;
end.
|