CRegistry:GetStr


The GetStr method returns a string 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

sValue = CRegistry:GetStr( sName, sDefault )

bullet.gif    sValue is a string value returned from the Registry.

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

bullet.gif    sDefault is the default string value returned if sName is not found in the Registry.

Example

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

R = CRegistry:Open( sKeyName )

-- open the key and create a CRegistry object

v = R:GetStr( "MyVal", "def" )

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

Printf( "MyVal= \'%s\' ", v )

-- Result: MyVal= 'def' (value did not already exist)

Related Topics

CRegistry class, SetStr


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