ReadINI

From SCAR Divi Manual
Revision as of 11:58, 1 July 2011 by Freddy (talk | contribs) (Created page with "==Definition== <source lang="scar" lines="false"> function ReadINI(Section, KeyName, FileName: string): string; </source> ==Availability== SCAR Divi 3.00 > Current ==Descriptio...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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. If FileName contains an invalid file path, it will error and stop the script. If the file specified by FileName does not exist, it will return an empty string as well.

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