Category : Pascal Source Code
Archive   : PASTUT.ZIP
Filename : BINOUT.PAS

 
Output of file : BINOUT.PAS contained in archive : PASTUT.ZIP
(* 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 *)




{ Result of execution

Begin outputting data
End of output

(In addition to the above output to the monitor, the file
named KIBBLES.BIT is created and filled with binary data.)

}


  3 Responses to “Category : Pascal Source Code
Archive   : PASTUT.ZIP
Filename : BINOUT.PAS

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/