Was sind das für seltsame Ressourcenschutzblöcke?
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var
fs: TFileStream;
i: Integer;
begin
fs := TFileStream.Create('d:\test.txt', fmCreate);
try
i := 36;
fs.WriteBuffer(i, sizeof(Integer));
finally
FreeAndNil(fs);
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
var
fs: TFileStream;
i: Integer;
begin
fs := TFileStream.Create('d:\test.txt', fmOpenRead);
try
fs.ReadBuffer(i, sizeof(Integer));
ShowMessage(IntToStr(i));
finally
FreeAndNil(fs);
end;
end;
so wie ihr die da habt bringen sie absolut nichts.