summaryrefslogtreecommitdiff
path: root/fpcsrc/tests/webtbs/tw4704.pp
blob: adb52e9ff43ce06aa1f1c0613d71f6478c3267bd (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
{ %OPT=-S2 }
{ Source provided for Free Pascal Bug Report 4704 }
{ Submitted by "Phil H." on  2006-01-17 }
{ e-mail: pjhess@purdue.edu }
program TestExcep;

uses
  SysUtils,
  Variants;

var
  AnInt : Integer;
  AVar  : Variant;
  
begin
  AVar := Null;
  try
    AnInt := AVar;
    halt(1);
    case AnInt of
      1 : ;
      end;
    
  except 
    on E: EVariantError do
      begin
      WriteLn('Handled EVariantError');
      WriteLn(E.ClassName);
      WriteLn(E.Message);
      if (E.Message = '') then
        halt(3);
      end;
    on E: Exception do
      begin
      WriteLn('Handled Exception');
      WriteLn(E.ClassName);
      WriteLn(E.Message);
      halt(2);
      end;
    end;
  
end.