GetSetting (function)

Syntax

GetSetting([appname], section, key[, default])

Description

Retrieves an specific setting from the system registry.

Comments

The GetSetting function has the following named parameters:

 

Parameter

Description

 

appname

String expression specifying the name of the application from which the setting will be read.

 

section

String expression specifying the name of the section within appname to be read.

 

key

String expression specifying the name of the key within section to be read.

 

default

An optional String expression specifying the default value to be returned if the desired key does not exist in the system registry. If omitted, then an empty string is returned if the key doesn’t exist.

Example

Sub Main()

  SaveSetting appname := "NewApp", section := "Startup", _

  key :="Height", setting := 200

  SaveSetting appname := "NewApp", section := "Startup", _

  key :="Width", setting := 320

    MsgBox GetSetting(appname :="NewApp", section := "Startup", _

  key :="Height", default := "50")

  DeleteSetting "NewApp" ' Delete the NewApp key

End Sub

See Also

GetAllSettings (function), DeleteSetting (statement), SaveSetting (statement)

Note

Under Win32, this statement operates on the system registry. All settings are read from the following entry in the system registry:

HKEY_CURRENT_USER\Software\BasicScript Program Settings\appname\section\key

On this platform, the appname parameter is not optional.

More information

G