File input/output: Difference between revisions

→‎{{header|Object Pascal}}: adjust the example to the task.
m (→‎{{header|Pascal}}: add link to Object Pascal)
(→‎{{header|Object Pascal}}: adjust the example to the task.)
Line 1,139:
For procedural code see the [[File_IO#Delphi | Delphi]] code, which is perfectly fine in ObjectPascal.
 
For a more object oriented style one can use a TFilestream (taken from [http://wiki.freepascal.org/File_Handling_In_Pascal]):
 
<lang pascal>var
Buffer: array[0..10000] of Byte;
begin
with TFileStream.Create('SomeFileinput.bintxt', fmCreatefmOpenRead) do
try
SeekSaveToFile('Hellooutput.txt');
Write(Buffer, SizeOf(Buffer));
finally
Free;
Anonymous user