Difference between revisions of "TIniFile.ReadSection"
m (→Example) |
m |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
'''procedure ReadSection(const Section: string; Strings: [[TStrings]])''' | '''procedure ReadSection(const Section: string; Strings: [[TStrings]])''' | ||
Section: Section to be read | Section: Section to be read | ||
− | Strings: | + | Strings: Keys found in section |
==Description== | ==Description== | ||
− | This procedure reads | + | This procedure reads Key names in section of [[TIniFile]] and saves them as [[TStrings]] |
==Example== | ==Example== | ||
− | Below example will read | + | Below example will read NETWORK section of soldat.ini on startup |
<syntaxhighlight lang="pascal"> | <syntaxhighlight lang="pascal"> | ||
var | var |
Latest revision as of 20:15, 22 August 2013
procedure ReadSection(const Section: string; Strings: TStrings) Section: Section to be read Strings: Keys found in section
Description
This procedure reads Key names in section of TIniFile and saves them as TStrings
Example
Below example will read NETWORK section of soldat.ini on startup
var
list: TStringList;
ini: TIniFile;
i: integer;
begin
list := File.CreateStringList();
// assuming Sandbox Level < 2
ini := File.CreateINI('soldat.ini');
ini.ReadSection('NETWORK',list);
for i:=0 to list.Count-1 do
WriteLn('>> '+list[i]);
list.Free;
ini.Free;
end.