TIniCollection.SaveToIni procedure
Save the collection to a
TCustomIniFile descendent.
Declaration
procedure SaveToIni(Ini: TCustomInifile; Section: string); virtualArguments
Ini | Inifile class to use when writing data. |
Section | Section to which to write the global data. |
Description
SaveToIni does the actual writing. It writes the number of
elements in the global section (as specified by the
Section argument), as
well as the section name for each item in the list. The item names are
written using the
Prefix property
for the key. After this it calls the
SaveToIni method of all
TIniCollectionItem instances.
This means that the global section of the .ini file will look something like this:
[globalsection] Count=3 Prefix1=SectionPrefixFirstItemName Prefix2=SectionPrefixSecondItemName Prefix3=SectionPrefixThirdItemName
This construct allows to re-use an ini file for multiple collections.
After this method is called, the GlobalSection property contains the
value of Section, it will be used in the
Save method.
See also
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
