Tschuldigung die größe in WriteBuffer ist ein Int64 Type
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender : TObject);
var s : TFileStream;
x : Int64;
begin
SetLength(actions, 20);
actions[0].cstr1 := Edit1.Text;
x := Sizeof(actions);
s := TFileStream.Create('c:\test.rec', fmCreate);
try
s.WriteBuffer(Actions, x);
finally
s.Free;
end;
end;
procedure TForm1.Button2Click(Sender : TObject);
var s : TFileStream;
x : Int64;
begin
s := TFileStream.Create('c:\test.rec', fmOpenRead);
try
x := s.Size;
s.ReadBuffer(Actions, x);
finally
s.Free;
end;
Edit1.Text := actions[0].cstr1;
end;