CRegistry:GetNum


The GetNum method returns a numeric value form a registry key. The method also specifies a default value to be returned if the named value or key does not already exist in the Registry.

Syntax

nValue = CRegistry:GetNum( sName, nDefault )

bullet.gif    nValue is a numeric value returned as a real number.

bullet.gif    sName is the name of the value to fetch.

bullet.gif    nDefault is the default numeric value returned if sName is not found in the Registry.

Example

The following script opens a key specified by sKeyName and returns a numeric value saved under the name "MyVal":

R = CRegistry:Open( sKeyName )

-- open the key and create a CRegistry object

v = R:GetNum( "MyVal", 16.25 )

-- fetch the value of "MyVal", default to 16.25

Printf( "MyVal= %lg", v )

-- Result: MyVal= 12.484 (value already existed)

Related Topics

CRegistry class, SetNum


Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics, Inc. All Rights Reserved.