INI_GET

This command is used to read the current setting from an .ini file. It returns the value of the requested .ini file setting, formatted as a string.

Syntax

INI_GET "file_path\ini_file_name", "section", "ini_setting", "default_value"

If you specify only an ini_file_name without the file_path, GainSeeker will look for this file in your Windows Folder.

.ini files use square brackets [ ] to specify the name of each section. Do not include these brackets when specifying the "section" parameter.

.ini files store information in the format ini_setting=value. Do not include the Equals symbol when specifying the "ini_setting" parameter.

If the INI_GET command does not find the specified file, "section" or "ini_setting", it will return the "default_value" you specify.

Return value

This command returns the value of the requested .ini file setting, up to 4095 characters, formatted as a string.

Notes

However, if the filename parameter is a variable (for example: MySvar "Path"), use should only use two backslashes. Using three slashes in this event causes an error.

If you are upgrading from GainSeeker version 8.0 or earlier and using UNC paths, you must update your templates to reflect this.

Example

INI_GET "Cms.ini", "qa/s var", "odbc", "B"

This formula looks for the Cms.ini file in the Windows folder on this computer, looks for a "[qa/s var]" section in this file, and then looks for an "odbc=" setting in this section.

If found, it returns the value of this "odbc=" setting. Otherwise, it returns "B".