Einzelnen Beitrag anzeigen

Benutzerbild von Neutral General
Neutral General

Registriert seit: 16. Jan 2004
Ort: Bendorf
5.219 Beiträge
 
Delphi 10.2 Tokyo Professional
 
#4

Re: FileToString: Wie String zu "StringToFile?"

  Alt 26. Sep 2006, 17:03
Delphi-Quellcode:
Procedure StringToFile(VAR FileName, Str: string);
var
  fs: TFileStream;
  Len: Integer;
begin
  fs := TFileStream.Create(FileName, fmOpenRead or fmShareDenyWrite);
  try
    Len := Length(Str);
    fs.Write(Len, SizeOf(Integer));
    fs.Write(Str[1], Len);
  finally
    fs.Free;
  end;
end;
so müsstes gehn

Gruß
Neutral General
Michael
"Programmers talk about software development on weekends, vacations, and over meals not because they lack imagination,
but because their imagination reveals worlds that others cannot see."
  Mit Zitat antworten Zitat