Yurttas/PL/IL/Ada-95/Exceptions/ehand 02.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_02.adb
18
19
20with Text_IO; use Text_IO;
21
22with EHand_00_P;
23
24procedure EHand_02 is 
25
26  package EH00 is new EHand_00_P; use EH00;
27
28  dv : Boolean := True;
29
30begin
31
32  while dv
33  loop
34    begin
35      case dv is
36      when False => PA;
37                    Put_Line("One,");
38      when True  => PB;
39                    Put_Line("Two,");
40                    dv := not dv;
41      end case;
42    exception
43      when others => Put_Line(" done.");
44    end;
45  end loop;
46
47  Put_Line(" First.");
48
49  while not dv
50  loop
51    begin
52      case dv is
53      when True  => PB;
54                    Put_Line("Three,");
55      when False => PA;
56                    Put_Line("Four,");
57                    dv := not dv;
58      end case;
59    exception
60      when others => Put_Line(" done.");
61    end;
62  end loop;
63
64  Put_Line(" Last.");
65
66end EHand_02;