Yurttas/PL/IL/Ada-95/F/05/00/E/io enumerate p.adb

From ZCubes Wiki
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-- date   : January 1, 1998.
12-- author : Salih Yurttas.
13
14-- io_enumerate_p.adb
15
16
17package body IO_Enumerate_P is
18
19  package E_IO is new Enumeration_IO(First_Last);
20  use E_IO;
21
22  function Get_Enumerate(Prompt : in String) return First_Last is
23    V : First_Last;
24  begin
25
26    New_Line;
27
28    Put(Prompt);
29    Get(V);
30
31    New_Line;
32
33    return V;
34
35  end Get_Enumerate;
36
37  procedure Get_Enumerate(Prompt : in String;
38                          V      : out First_Last) is
39  begin
40
41    New_Line;
42
43    Put(Prompt);
44    Get(V);
45
46    New_Line;
47
48  end Get_Enumerate;
49
50  procedure Put_Enumerate(Header : in String;
51                          V      : in First_Last) is
52  begin
53
54    New_Line;
55
56    Put_Line(Header);
57    Put(V);
58
59    New_Line;
60
61  end Put_Enumerate;
62
63end IO_Enumerate_P;