home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / PASSRC.ZIP / BININ.PAS < prev    next >
Pascal/Delphi Source File  |  1991-02-04  |  757b  |  35 lines

  1.                                 (* Chapter 11 - Program 7 *)
  2. program Binary_Input;
  3.  
  4. type Input_Record = record
  5.        Number : integer;
  6.        Amount : real;
  7.        Name   : string[30];
  8.      end;
  9.  
  10. var Input_File : file of Input_Record;
  11.     Bird_Food  : array[1..20] of Input_Record;
  12.     Index      : byte;
  13.  
  14. begin  (* main program *)
  15.    Assign(Input_File,'KIBBLES.BIT');
  16.    Reset(Input_File);
  17.  
  18.    for Index := 1 to 20 do
  19.       if not Eof(Input_File) then
  20.          Read(Input_File,Bird_Food[Index]);
  21.    Close(Input_File);
  22.  
  23.    Writeln(Bird_Food[6].Number:6,Bird_Food[20].Amount:13:5,
  24.            '  ',Bird_Food[1].Name);
  25. end.  (* of main program *)
  26.  
  27.  
  28.  
  29.  
  30. { Result of execution
  31.  
  32.      6  12345.67890  Large size Kibbles & Bits
  33.  
  34. }
  35.