Syntax
|
DeleteSetting appname [,section [,key]]
|
Description
|
Deletes a setting from the registry.
|
Comments
|
You can control the behavior of DeleteSetting by omitting parameters. If you specify all three parameters, then DeleteSetting deletes your specified setting. If you omit key, then DeleteSetting deletes all of the keys from section. If both section and key are omitted, then DeleteSetting removes that application’s entry from the system registry.
The following table describes the named parameters to the DeleteSetting statement:
|
|
Parameter
|
Description
|
|
appname
|
String expression indicating the name of the application whose setting will be deleted.
|
|
section
|
String expression indicating the name of the section whose setting will be deleted.
|
|
key
|
String expression indicating the name of the setting to be deleted from the registry.
|
Example
|
'The following example adds two entries to the Windows registry
'if run under Win32 or to NEWAPP.INI on other platforms,
'using the SaveSetting statement. It then uses DeleteSetting
'first to remove the Startup section, then to remove
'the NewApp key altogether.
Sub Main()
SaveSetting appname := "NewApp", section := "Startup", _
key := "Height", setting := 200
SaveSetting appname := "NewApp", section := "Startup", _
key := "Width", setting := 320
DeleteSetting "NewApp", "Startup" 'Remove Startup section
DeleteSetting "NewApp" 'Remove NewApp key
End Sub
|
See Also
|
SaveSetting (statement), GetSetting (function), GetAllSettings (function)
|
Notes
|
Under Win32, this statement operates on the system registry. All settings are saved under the following entry in the system registry:
HKEY_CURRENT_USER\Software\BasicScript Program Settings\appname\section\key
|