Previous - iniList Section Home - Registry and INI Next - regWrite


regRead ( )

reads a value from the windows registry

Usage:

regRead (object me, string key, string subkey, string valueName )

Parameters:

key (string) - The predefined root key. The possible Values are:

"HKEY_CLASSES_ROOT"
"HKEY_CURRENT_USER"
"HKEY_LOCAL_MACHINE"
"HKEY_USERS"
"HKEY_DYN_DATA"

subkey (string) - The path containing the string to open the registry value

valueName (string) - The name to value to read

Returns:

(property list) - A property list with 2 properties: #Type and #Value. Some examples of returned values are:
[#Type: "STRING", #Value: "HELLO"]
[#Type: "BINARY", #Value: "" ]
[#Type: "MULTI_STRING", #Value: ["hello","world"] ]
[#Type: "INTEGER", #Value: 22]
[#Type: "EXPAND_STRING", #Value: "%win%win.ini"]

Example:

xtRose = xtra("Rosetta").new( )
strColor = xtRose.regRead( "HKEY_CURRENT_USER", "Software\Macromedia\Director\8.5\ColorPopup", "FavoriteColor1" )

Notes:

Using a property list was necessary since the return value could be string or integer. The property #Type helps clarify the data type in the registry.


Previous - iniList Section Home - Registry and INI Next - regWrite