Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- with Ada.Text_IO;
- with Ada.Sequential_IO;
- procedure Test_Driver is
- type Interest_Field is
- array(1..10) of Integer;
- type Person_Handling is
- record
- Last_Name : String(1..20);
- First_Name : String(1..20);
- Street : String(1..20);
- Zip_Code : String(1..20);
- Nr_Of_Interests : Integer;
- Interests : Interest_Field;
- end record;
- package Person_IO is
- new Ada.Sequential_IO(Element_Type => Person_Handling);
- use Person_IO;
- Original : Person_IO.File_Type;
- Output : Ada.Text_IO.File_Type;
- P : Person_Handling;
- begin
- Open(File => Original,
- Mode => In_File,
- Name => "REG.BIN");
- Create(File => Output,
- Mode => Out_File,
- Name => "OUTPUT.TXT");
- while not End_Of_File(Original) loop
- Read(Original, P);
- Ada.Text_IO.Put(Output, P.Last_Name(1..20));
- Ada.Text_IO.New_Line(2);
- end loop;
- Close(Original);
- Close(Output);
- end Test_Driver;
Add Comment
Please, Sign In to add comment