Yurttas/PL/IL/Ada-95/Exceptions/ehand 00 p.adb

From ZCubes Wiki
Revision as of 03:38, 5 November 2013 by MassBot1 (talk | contribs) (Created page with "<syntaxhighlight lang="ada" line start="1" enclose="div">-- -- Copyright (C) 1998 -- All Rights Reserved. Salih Yurttas, ZCubes, BitsOfCode Software Systems, Inc.. -- -- Permi...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
 1--
 2-- Copyright (C) 1998
 3-- All Rights Reserved. Salih Yurttas, ZCubes, BitsOfCode Software Systems, Inc..
 4--
 5-- Permission to use, copy, modify, and distribute this 
 6-- software and its documentation for EDUCATIONAL purposes
 7-- and without fee is hereby granted provided that this 
 8-- copyright notice appears in all copies. 
 9-- 
10-- 
11 
12-- date   : January 1, 1998.
13-- author : Salih Yurttas.
14
15-- purpose : Error handling by exceptions.
16
17-- ehand_00_p.adb
18
19
20package body EHand_00_P is
21
22  X : exception;
23
24  procedure PA is 
25  begin
26    PC;
27  exception
28    when X      => Put("PA:X ");
29    when others => Put("PA:others ");
30  end PA;
31
32  procedure PB is 
33  begin
34    raise X;
35  exception
36    when X => Put("PB:X ");
37  end PB;
38
39  procedure PC is 
40    X : exception;
41  begin
42    PB;
43  exception
44    when X      => Put("PC:X ");
45    when others => Put("PC:others ");
46  end PC;
47
48end EHand_00_P;