System.Classes.TStrings.SaveToFile
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
- System.Classes.TStrings.SaveToStream
- System.Classes.TStrings.LoadFromFile
- System.Classes.TStrings.Encoding
- System.Classes.TStrings.Strings
- System.Classes.TStrings.Text
- System.Classes.TStrings.LineBreak
- System.Classes.TStrings.TrailingLineBreak
- System.Classes.TStrings.WriteBOM
- System.SysUtils.TEncoding.GetPreamble