Difference between revisions of "TIniFile.ValueExists"
(new page) |
(No difference)
|
Revision as of 00:42, 23 August 2013
function ValueExists(const Section, Ident: String): Boolean Section: Section name Ident: Property name (key)
Description
This procedure returns TRUE if a key exists and FALSE otherwise
Example
example.ini in soldatserver's root folder;
[Section1]
Key1=1
Key2=var
ini: TIniFile;
temp: Boolean;
begin
// assuming Sandbox Level < 2
ini := File.CreateINI('example.ini');
temp := ini.ValueExists('Section1','Key1'); // temp = TRUE
temp := ini.ValueExists('Section1','Key2'); // temp = TRUE
temp := ini.ValueExists('Section1','Key3'); // temp = FALSE
ini.Free;
end.