valueExists

valueExists

Returns whether a value for the given key exists.

Method of

WinReg object

Syntax

boolean valueExists ( string key, string value );

Parameters

The method has the following parameters:

key
A string representing the path to the key.
value
A string representing the value being queried.

Returns

Boolean value: true if the key exists and the user has read access to it, otherwise false.

Example

winreg = getWinRegistry();
if ( winreg != null )
{
    winreg.setRootKey( winreg.HKEY_LOCAL_MACHINE);
    if(winreg.valueExists("SOFTWARE\\mozilla", "value name"))
    {
    //valueExists returned true
    } else {
    //valueExists returned false
    }
}

Document Tags and Contributors

 Last updated by: Sheppy,