ФВ
Фёдор Волков
cinst Fname = '123.dat';
var Fin, Fout : File; Buf : array [0..255] of Byte; Size : Integer;
Str : String;
begin
Assign(Fin, Fname);
Rename(Fin, 'tmp.tmp');
Reset(Fin, 1);
Rewrite(Fout, 1);
while not eof(Fin) do
begin
BlockRead(Fin, Buf, 256, Size);
BlockWrite(Fout, Buf, Size);
end;
{ число 0 }
Buf[0] := 0; BlockWrite(Fout, Buf, 1);
{ фразу }
Str := 'До свидания'; for Size := 1 to Length(Str) do Buf[Size - 1] := Ord(Str[Size]);
BlockWrite(Fout, Buf, Length(Str));
Close(Fin);
Close(Fout);
Erase(Fin);
end.