SubKeyExists(SubKeyName: String): Boolean;
SubKeyName. Name of the subkey, which presence should be checked.
The SubKeyExists method checks presence of subkey in the registry.
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: