home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power Programming
/
powerprogramming1994.iso
/
progtool
/
pascal
/
pascsrc.arc
/
BINOUT.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1988-01-15
|
788b
|
30 lines
(* Chapter 11 - Program 6 *)
program Binary_Output_Example;
type Dat_Rec = record
Count : integer;
Size : real;
Name : string[30];
end;
var Output_File : file of Dat_Rec;
Dog_Food : array[1..20] of Dat_Rec;
Index : byte;
begin (* main program *)
Assign(Output_File,'KIBBLES.BIT');
Rewrite(Output_File);
for Index := 1 to 20 do begin
Dog_Food[Index].Count := Index;
Dog_Food[Index].Size := 12345.6789;
Dog_Food[Index].Name := 'Large size Kibbles & Bits';
end;
Writeln('Begin outputting data');
for Index := 1 to 20 do
Write(Output_File,Dog_Food[Index]);
Close(Output_File);
Writeln('End of output');
end. (* of main program *)