System.Classes.TStrings.SaveToFile

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure SaveToFile(const FileName: string); overload; virtual;
procedure SaveToFile(const FileName: string; Encoding: TEncoding); overload; virtual;

C++

virtual void __fastcall SaveToFile(const System::UnicodeString FileName)/* overload */;
virtual void __fastcall SaveToFile(const System::UnicodeString FileName, System::Sysutils::TEncoding* Encoding)/* overload */;

Properties

Type Visibility Source Unit Parent
procedure
function
public
System.Classes.pas
System.Classes.hpp
System.Classes TStrings

Description

Saves the strings in the current object to the specified FileName file.

SaveToFile does the same thing as SaveToStream when it writes to a file stream, except that SaveToFile creates and destroys the file stream.

Each string from the list is written to a separate line in the file.

If the Encoding parameter is not given, then the strings are saved with the encoding specified in the Encoding property.

See Also

Code Examples