Previous - regRead Section Home - Registry and INI Next - regDelete


regWrite ( )

Writes a value to the windows registry.

Usage:

regWrite (object me, string key, string subkey, string valueName, object dataPropList )

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 of value to write

dataPropList ( property list ) - a property list with the property #Type and #Value. This list is exactly the same as the property list returned by regRead( ). The possible values for property #type are: "STRING", "BINARY", "MULTI_STRING", "INTEGER" and "EXPAND_STRING".

Returns:

(integer) - The success code

Example:

xtRose = xtra("Rosetta").new( )
bSuccess = xtRose.regWrite( "HKEY_CURRENT_USER", "Software\Macromedia\Director\8.5\ColorPopup", "FavoriteColor1", [#Type: "STRING", #Value: "#000000"] )

Notes:

When the subkey and valueName already exist, regWrite will overwrite the existing value. If the subkey or valueName doesn't exist, they will be created.


Previous - regRead Section Home - Registry and INI Next - regDelete