ReadINI

From SCAR Divi Manual
Revision as of 12:59, 1 July 2011 by Freddy (talk | contribs) (Description)
Jump to: navigation, search

Definition

function ReadINI(Section, KeyName, FileName: string): string;

Availability

SCAR Divi 3.00 > Current

Description

Reads data from a file with an INI structure specified by the path FileName. It reads the value of the key specified by KeyName in the section specified by Section. If the Section or KeyName are empty it will return an empty string, it will also do this if the file specified by FileName does not exist. If FileName contains an invalid file path, it will error and stop the script.

File structure

[Section]
Key=Value

Example

begin
  WriteINI('Section', 'Key', 'Hello World!', LogsPath + 'Test.ini');
  WriteLn(ReadINI('Section', 'Key', LogsPath + 'Test.ini'));

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

Output:

Hello World!

See Also