Difference between revisions of "INISectionExists"

From SCAR Divi Manual
Jump to: navigation, search
(See Also)
Line 26: Line 26:
  
 
==See Also==
 
==See Also==
*[[INISectionExists]]
+
*[[INIKeyExists]]
 
*[[ReadINI]]
 
*[[ReadINI]]
 
*[[DeleteINI]]
 
*[[DeleteINI]]

Revision as of 12:30, 1 July 2011

Definition

function INIKeyExists(const Section, KeyName, FileName: string): Boolean;

Availability

SCAR Divi 3.25 > Current

Description

Returns true if a key specified by KeyName in a section specified by Section in an INI file specified by FileName exists. If the file does not exist, the function returns false as well. When FileName contains an invalid file path, an exception is thrown and the script is stopped.

Example

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

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

Output:

0
1

See Also