CRegistry:GetBool


The GetBool method returns a Boolean (true or false) 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

bValue = CRegistry:GetBool( sName, bDefault )

bullet.gif    bValue is a Boolean (logical) true or false value.

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

bullet.gif    bDefault is the default value (true or false) returned if sName is not found in the Registry.

Example

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

R = CRegistry:Open( sKeyName )

-- open the key and create a CRegistry object

v = R:GetBool( "MyVal", true )

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

Printf( "MyVal= %d", v )

-- Result: MyVal= 1 (0 or 1 if using %d format)

Related Topics

CRegistry class, SetBool


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