Skip to main content
Skip table of contents

GetINISetting

Purpose

Returns the value associated with the requested key from an INI file.


Parameters

Parameter: section
Type: string
Description: Name of section in INI file to get,such as "Settings" for the HomeSeer settings section.

Parameter: key
Type: string
Description: Name of the key in the INI file to access.

Parameter: default
Type: string
Description: The default value to return if the key is not found.

Parameter: filename
Type: string (optional)
Description: The file name of the INI file to access.  The file name is relative to the "config" folder in the HomeSeer program directory (C:\Program Files\HomeSeer 2\Config by default).  If this parameter is omitted, the HomeSeer settings.ini file is used.


Returns

Return value: ini key value
Type: string


Example

Sample Code

VB
Sub Main(ByVal Parms As Object)
        Dim ConfigFileName As String = ""
 
        ' Get the name of the current HomeSeer configuration file.
        ConfigFileName = hs.GetINISetting("Settings", "configfile", "")
        hs.WriteLog("Config", "The current HomeSeer configuration file is " & ConfigFileName)
 
    End Sub


JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.