Yurttas/PL/IL/Ada-95/F/05/00/PS/io pointer string p.adb
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-- io_pointer_string_p.adb
16
17
18package body IO_Pointer_String_P is
19
20 function Get_Pointer_String(Prompt : in String) return Pointer_String is
21 Max_Size : Integer := 64;
22
23 T : String(1..Max_Size);
24
25 Length : Integer;
26
27 V : Pointer_String;
28 begin
29
30 New_Line;
31
32 Put(Prompt);
33 Get_Line(T,Length);
34 V := new String'(T(1..Length));
35
36 New_Line;
37
38 return V;
39
40 end Get_Pointer_String;
41
42 procedure Get_Pointer_String(Prompt : in String;
43 V : out Pointer_String) is
44 Max_Size : Integer := 64;
45
46 T : String(1..Max_Size);
47
48 Length : Integer;
49 begin
50
51 New_Line;
52
53 Put(Prompt);
54 Get_Line(T,Length);
55 V := new String'(T(1..Length));
56
57 New_Line;
58
59 end Get_Pointer_String;
60
61 procedure Put_Pointer_String(Header : in String;
62 V : in Pointer_String) is
63 begin
64
65 New_Line;
66
67 Put_Line(Header);
68 Put(V.all);
69
70 New_Line;
71
72 end Put_Pointer_String;
73
74end IO_Pointer_String_P;