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 To uniquely If key does not exist in the |
|
valuename |
A string containing the name of a value in the If |
|
valuetype |
A value of the RegistryValueType enumerated datatype
|
|
value |
A variable corresponding to the datatype of |
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 There are four root
A key is uniquely identified by the list of
|
||||
|
Value name |
The name of a value belonging to the key. A key can |
||||
|
Value type |
A value identifying the datatype of a value in the |
||||
|
Value |
A value associated with a value name or an unnamed |
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