GetINISections

From SCAR Divi Manual
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