ReadBoolean(ValueName: String): Boolean;
ValueName. Name of the parameter, which value should be obtained.
The ReadBoolean method reads logic value from the REG_DWORD parameter in the registry. If the ValueName parameter does not exist, an exception is thrown.
Executing the example requires that the registry subkey HKEY_CURRENT_USER\Software\MyProject\Params contains the REG_DWORD parameter with the Param1 name.
Sub Main;
Var
RegKey, SubKey: IRegistryKey;
b: Boolean;
Begin
RegKey := RegistryClass.CurrentUser;
SubKey := RegKey.OpenSubKey("Software\MyProject\Params", False);
If SubKey.ValueExists("Param1") Then
b := SubKey.ReadBoolean("Param1")
End If;
End Sub Main;
After executing the example the Param1 parameter is searched in the registry subkey HKEY_CURRENT_USER\Software\MyProject\Params. If the parameter exists, logical value that is contained in this parameter is read into the "b" variable.
See also: