TIniFile.ReadSections

From Soldat Community Wiki
Revision as of 20:10, 22 August 2013 by Mighty (talk | contribs) (new page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
procedure ReadSections(Strings: TStrings)
 Section: Section to be read
 Strings: Lines read

Description

This procedure reads all sections' names and saves them to TStrings

Example

Below example will read all sections of soldat.ini and save them to list

var
  list: TStringList;
  ini: TIniFile;
  i: integer;

begin
  list := File.CreateStringList();
  // assuming Sandbox Level < 2
  ini := File.CreateINI('soldat.ini');
  
  ini.ReadSections(list);
  for i:=0 to list.Count-1 do
    WriteLn('>> '+list[i]);
  
  list.Free;
  ini.Free;
end.