Yurttas/PL/IL/Ada-95/F/02/03/01/error handling 02 p.adb

Revision as of 04:52, 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)
 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-- error_handling_02_p.adb
18
19
20with Ada.Text_IO; use Ada.Text_IO;
21
22package body Error_Handling_02_P is
23
24  E : exception;
25
26  procedure PA is 
27  begin
28    PC;
29  exception
30    when E      => Put("PA:E ");
31    when others => Put("PA:others ");
32  end PA;
33
34  procedure PB is 
35  begin
36    raise E;
37  exception
38    when E => Put("PB:E ");
39  end PB;
40
41  procedure PC is 
42    E : exception;
43  begin
44    PB;
45  exception
46    when E      => Put("PC:E ");
47    when others => Put("PC:others ");
48  end PC;
49
50end Error_Handling_02_P;