System.WideStrings.TWideStrings.LoadFromFile
Delphi
procedure LoadFromFile(const FileName: WideString); overload; virtual;
procedure LoadFromFile(const FileName: WideString; Encoding: TEncoding); overload; virtual;
C++
virtual void __fastcall LoadFromFile(const System::WideString FileName)/* overload */;
virtual void __fastcall LoadFromFile(const System::WideString FileName, System::Sysutils::TEncoding* Encoding)/* overload */;
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
procedure function |
public | System.WideStrings.pas System.WideStrings.hpp |
System.WideStrings | TWideStrings |
Description
Fills the list with the lines of text in a specified file.
Call LoadFromFile to fill the list of the TWideStrings object from the file specified by FileName. LoadFromFile first clears any strings already in the list. Then, each line in the file, as indicated by carriage return or linefeed characters, is appended as a string in the list.
If the Encoding parameter is not given, then the strings are loaded using the appropriate encoding. The value of the encoding is obtained by calling the GetBufferEncoding routine of the TEncoding class.
Note: LoadFromFile uses the Add method to add the strings that are read from the file.