Yurttas/PL/IL/Ada-95/F/05/02/00/read p.adb

From ZCubes Wiki
Revision as of 05:47, 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.. -- -- Permis...")
(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-- date   : December 4, 1989.
12-- author : Michael Nobles.
13
14-- read_p.adb
15
16
17package body Read_P is
18
19  procedure Read_Rec(DataN : in Pointer_String;
20                     Size  : in Integer) is
21    L        : Integer;
22    Rec_Num  : Integer;
23    Status   : Integer := 1;
24    Dummy    : String(1..20);
25    Temp_Rec : Data_Rec;
26  begin
27    Get_Line (Dummy,L);
28    Fix_Cursor (12,5);
29    Put(" Enter Record Number : ");
30    Int_IO.Get(Rec_Num);
31
32    Randomize('r',
33              DataN,
34              Rec_Num,
35              Temp_Rec,
36              Size,
37              Status);
38
39    if Status = 1 then
40      if Temp_Rec.day = 0 then
41        Fix_Cursor(14,5);
42        Put(" Sorry, that Record Number has no Data Assigned...");
43      else
44        Show_Rec(Temp_Rec, Rec_Num);
45      end if;
46    elsif Status = 0 then
47      Fix_Cursor (14,5);
48      Put(" Sorry, that Record Number was not found...");
49    else
50      Fix_Cursor (14,5);
51      Put("*** Error when Reading the File...");
52    end if;
53
54    Fix_Cursor (21,5);
55    Put("->Enter any letter to continue...");
56    Get_Line(Dummy,L);
57    Get_Line(Dummy,L);
58    Clear_Bottom (10);
59  end Read_Rec;
60
61end Read_P;