| Stonefield Query SDK |
| SetRegistryValue |
Syntax
SetRegistryValue(ValueName as String, Value as String, Node as String) as Boolean
Parameters
ValueName
The name of the value in the Registry.
Value
The value to store.
Node
The name of the node in the Registry to store the value in. If this parameter isn't passed, the value is stored in HKEY_CURRENT_USER\Software\CompanyName\ApplicationName\Options (where CompanyName and ApplicationName are the values of the Company Name and Application Name configuration settings). If a value is passed and it doesn't contain a backslash (\), that node is used instead of Options. For example, specifying "Data" means that HKEY_CURRENT_USER\Software\CompanyName\ApplicationName\Data is used. If it does contain a backslash, then it must be a complete path to any place in the Registry, such as HKEY_LOCAL_MACHINE\Software\Whatever\SomeNode.
Return Value
True if the value was saved.
Example
Here's an example that adds a value to the Registry if a certain file exists.
Visual FoxPro
lparameters toApplication as SQApplication
if file('Settings.cfg')
toApplication.SetRegistryValue('Use Config Settings', 'Y')
endif VBScript
function Main(Application)
dim fso
set fso = CreateObject("Scripting.FileSystemObject")
if fso.FileExists("Settings.cfg")
Application.SetRegistryValue("Use Config Settings", "Y")
end if
end function JavaScript
function Main(Application, Directory) {
var fso ;
fso = new ActiveXObject('Scripting.FileSystemObject') ;
if (fso.FileExists('Settings.cfg'))
Application.SetRegistryValue('Use Config Settings', 'Y') ;
}See Also
Application Object | GetRegistryValue | SetINIValue
| Last Updated: 02/05/2008 |