Hi chris,
meinst du diesen Code:
Delphi-Quellcode:
// schreiben
var
iLen : integer;
fs : TFileStream;
ms : TMemoryStream;
begin
ms := TMemoryStream.Create;
fs := TFileStream.Create(....,fmCreate);
try
ms.Clear;
RichEdit1.Lines.SaveToStream(ms);
iLen := ms.Position;
fs.Write(iLen,4);
fs.CopyFrom(ms,0);
finally
FreeAndNil(fs);
FreeAndNil(ms);
end;
end;
// lesen
var
iLen : integer;
fs : TFileStream;
ms : TMemoryStream;
begin
ms := TMemoryStream.Create;
fs := TFileStream.Create('c:\temp\riform.txt',fmOpenRead);
try
fs.Read(iLen,4);
ms.Clear;
ms.CopyFrom(fs,iLen);
ms.Position := 0;
RichEdit1.Lines.LoadFromStream(ms);
finally
FreeAndNil(fs);
FreeAndNil(ms);
end;
end;
Wenn ja, kannst du mir kurz sagen, wo die Seperatoren sind, also, wie der Code funzt?
Danke