Irgendwat mach ich falsch
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var FStream : TStream;
Mstream : TMemoryStream;
iMSize : integer;
begin
Mstream := TMemoryStream.Create;
opendialog1.Execute;
FStream := TFileStream.Create(opendialog1.FileName,fmOpenReadWrite);
FStream.Seek(0,soFromEnd);
Memo1.Lines.SaveToStream(MStream);
FStream.CopyFrom(MStream,0);
iMSize := MStream.Size+sizeof(integer);
Fstream.Write(iMSize,SizeOf(IMSize));
MStream.Free;
Fstream.Free;
end;
procedure TForm1.Button2Click(Sender: TObject);
var FStream : TStream;
LStream : Tstream;
begin
opendialog1.Execute;
LStream := TStream.Create;
FStream := TFileStream.Create(opendialog1.FileName,fmOpenReadWrite);
FStream.Seek(sizeof(integer)+4,soFromEnd);
LStream.CopyFrom(Fstream,SizeOf(Integer)-4);
Memo2.Lines.LoadFromStream(LStream);
LStream.Free;
Fstream.Free;
end;
Also ich hab jetzt des gemacht, was in dem Pseudo Code steht
Sven W.