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-- purposeĀ : IO with key randomization using 'Direct_IO' package.
15
16-- dir_fp_00.adb
17
18
19with Dir_FP_P;
20use Dir_FP_P;
21
22with Menu_P;
23use Menu_P;
24
25with Current_File_P;
26use Current_File_P;
27
28with Read_P;
29use Read_P;
30
31with Write_P;
32use Write_P;
33
34with Find_P;
35use Find_P;
36
37Procedure Dir_FP_00 is
38
39 Size : Integer;
40 Choice : Integer;
41
42 Processing : Boolean := True;
43
44 Data_File_Name : Pointer_String;
45
46begin
47
48 Size := Data_Rec'SIZE;
49
50 Change_File(Data_File_Name,1);
51 Show_Menu;
52
53 while Processing
54 loop
55 Choice := Menu_Choice;
56
57 case Choice is
58 when 1 => Change_File(Data_File_Name,
59 2);
60
61 when 2 => Read_Rec(Data_File_Name,
62 Size);
63
64 when 3 => Write_Rec(Data_File_Name,
65 Size);
66
67 when 4 => Find_Rec(Data_File_Name,
68 Size);
69
70 when 5 => Processing := false;
71
72 when others => null;
73 end case;
74 end loop;
75
76 Dir_IO.Close(Data_FP);
77
78end Dir_FP_00;