GetINISections

From SCAR Divi Manual
Revision as of 12:06, 1 July 2011 by Freddy (talk | contribs) (Example)
(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;

begin
  WriteINI('Section', 'Key', 'Hello World!', LogsPath + 'Test.ini');
  WriteINI('Section2', 'Key', 'Hello World!', LogsPath + 'Test.ini');
  sa := GetINISections(LogsPath + 'Test.ini');
  WriteLn(Implode(',', sa));

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

Output:

Section,Section2

See Also