IRegistryKey.SubKeyExists

Syntax

SubKeyExists(SubKeyName: String): Boolean;

Parameters

SubKeyName - name of the subkey, which presence must be checked.

Description

The SubKeyExists method checks presence of subkey in the registry. The name of subkey is passed by the SubKeyName parameter.

Example

Sub Main;

Var

RegKey: IRegistryKey;

Begin

RegKey := RegistryClass.CurrentUser;

If RegKey.SubKeyExists("Software\MyProject\Params") Then

RegKey.DeleteSubKey("Software\MyProject\Params");

End If;

End Sub Main;

After executing the example the subkey HKEY_CURRENT_USER\Software\MyProject\Params is searched in the registry. If the subkey exists, it is deleted.

See also:

IRegistryKey