IRegistryKey.SubKeyExists

Syntax

SubKeyExists(SubKeyName: String): Boolean;

Parameters

SubKeyName. Name of the subkey, which presence should be checked.

Description

The SubKeyExists method checks presence of subkey in the registry.

Example

Add a link to the Registry system assembly.

Sub UserProc;
Var
    RegKey: IRegistryKey;
    SubKey: String = "Software\MyProject\Params";
Begin
    RegKey := RegistryClass.CurrentUser;
    If RegKey.SubKeyExists(SubKey) Then
        RegKey.DeleteSubKey(SubKey);
    End If;
End Sub UserProc;

After executing the example the specified subkey is searched in the registry. If the subkey exists, it is deleted.

See also:

IRegistryKey