Difference between revisions of "GetINISections"

From SCAR Divi Manual
Jump to: navigation, search
(Created page with "==Definition== <source lang="scar" lines="false"> function GetINISections(const FileName: string): TStringArray; </source> ==Availability== SCAR Divi 3.25 > Current ==Descripti...")
(No difference)

Revision as of 13:05, 1 July 2011

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