RegistrySet
PowerScript function
Description
Sets the value for a key and value name in the system registry. If
the key or value name does not exist, RegistrySet creates a new key or
name and sets its value.
Syntax
|
1 |
RegistrySet ( key, valuename, valuetype, value ) |
|
Argument |
Description |
|---|---|
|
key |
A string whose value names the key in the system registry To uniquely identify a key, specify the list of parent If key does not exist in the registry, RegistrySet creates |
|
valuename |
A string containing the name of a value in the registry. If valuename does not exist in the registry, RegistrySet |
|
valuetype |
A value of the RegistryValueType enumerated datatype
|
|
value |
A variable corresponding to the datatype of valuetype |
Return value
Integer. Returns 1 if it succeeds and -1 if an error occurs. An
error is returned if the datatype of valuevariable does not correspond to
the datatype specified in valuetype.
Usage
Long string values (more than 2048 bytes) should be stored as files
and the file name stored in the registry.
|
Item |
Description |
||||
|---|---|---|---|---|---|
|
Key |
An element in the registry. A key is part of a tree of There are four root strings:
A key is uniquely identified by the list of parent keys
|
||||
|
Value name |
The name of a value belonging to the key. A key can have |
||||
|
Value type |
A value identifying the datatype of a value in the |
||||
|
Value |
A value associated with a value name or an unnamed value. |
Examples
This example sets a value for the key Fonts and the value name
Title:
|
1 2 3 |
RegistrySet( & "HKEY_LOCAL_MACHINESoftwareMyAppFonts", & "Title", RegString!, sle_font.Text) |
This statement sets a value for the key Fonts and the value name
NameOfEntryNum:
|
1 2 3 4 |
ulong ul_num RegistrySet( & "HKEY_USERSMyApp.SettingsFonts", & "NameOfEntryNum", RegULong!, ul_num) |
See also