ReadDoubleDef(ValueName: String; DefaultValue: Double): Double;
ValueName. Name of the parameter, which value must be obtained.
DefaultValue. Value that is used if parameter does not exist.
The ReadDoubleDef method reads real value from binary parameter in the registry.
If the parameter with the ValueName name does not exist, the method returns DefaultValue.
Add a link to the Registry system assembly.
Sub UserProc;
Var
RegKey, SubKey: IRegistryKey;
d: Double;
Begin
RegKey := RegistryClass.CurrentUser;
SubKey := RegKey.OpenSubKey("Software\MyProject\Params", False);
d := SubKey.ReadDoubleDef("Param1", Double.MinValue);
End Sub UserProc;
After executing the example, real value is read from the parameter with the Param1 name located in the registry subkey [HKEY_CURRENT_USER\Software\MyProject\Params] into the "d" variable. If the parameter does not exist, the minimum real value is set into the variable.
See also: