IRegistryKey.ReadBooleanDef

Syntax

ReadBooleanDef(ValueName: String; DefaultValue: Boolean): Boolean;

Parameters

ValueName. Name of the parameter, which value must be obtained.

DefaultValue. Value that is used if parameter does not exist.

Description

The ReadBooleanDef method reads logical value from the REG_DWORD parameter in the registry.

Comments

If the ValueName parameter does not exist, the method returns DefaultValue.

Example

Add a link to the Registry system assembly.

Sub UserProc;
Var
    RegKey, SubKey: IRegistryKey;
    b: Boolean;
Begin
    RegKey := RegistryClass.CurrentUser;
    SubKey := RegKey.OpenSubKey("Software\MyProject\Params"False);
    b := SubKey.ReadBooleanDef("Param1"True);
End Sub UserProc;

After executing the example logical value is read from the parameter with the Param1 name located in the registry subkey [HKEY_CURRENT_USER\Software\MyProject\Params] into the "b" variable. If the parameter does not exist, the variable is set to True.

See also:

IRegistryKey