GetINISections

From SCAR Divi Manual
Revision as of 12:05, 1 July 2011 by Freddy (talk | contribs) (Created page with "==Definition== <source lang="scar" lines="false"> function GetINISections(const FileName: string): TStringArray; </source> ==Availability== SCAR Divi 3.25 > Current ==Descripti...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Definition

function GetINISections(const FileName: string): TStringArray;

Availability

SCAR Divi 3.25 > Current

Description

Returns a list as a TStringArray containing all sections in the INI file specified by FileName. When FileName contains an invalid file path, an exception is thrown and the script is stopped.

Example

var
  sa: TStringArray;
  i: Integer;

begin
  WriteINI('Section', 'Key', 'Hello World!', LogsPath + 'Test.ini');
  WriteINI('Section2', 'Key', 'Hello World!', LogsPath + 'Test.ini');
  sa := GetINISections(LogsPath + 'Test.ini');
  for i := Low(sa) to High(sa) do
    WriteLn(sa[i]);

  DeleteFile(LogsPath + 'Test.ini');
end.

Output:

Section
Section2

See Also