home *** CD-ROM | disk | FTP | other *** search
- PROGRAM binary_input;
-
- TYPE input_record = RECORD
- number : INTEGER;
- amount : REAL;
- name : STRING[30];
- END;
-
- VAR input_file : FILE of input_record;
- bird_food : ARRAY[1..20] OF input_record;
- index : BYTE;
-
- BEGIN (* main program *)
- ASSIGN(input_file,'KIBBLES.BIT');
- RESET(input_file);
-
- FOR index := 1 TO 20 DO
- IF NOT EOF(input_file) THEN
- READ(input_file,bird_food[index]);
- CLOSE(input_file);
-
- WRITELN(bird_food[6].number:6,bird_food[20].amount:13:5,
- ' ',bird_food[1].name);
-
- END. (* of main program *)