SYS_IniFileGetValue Function

Action

Retrieves a value from an open initialization (.ini) file on the target machine.

Syntax

sValue = SYS_IniFileGetValue (hIniFile, sSection, sName)
Variable Description
sValue The returned value. STRING.
hIniFile A handle to the file containing the value. HINIFILE.
sSection The section of the file containing the value to retrieve. STRING.
sName The name of the value to retrieve. STRING.

Notes

SYS_IniFileGetValue is executed by the Agent process, not the Silk Test Classic process; but it is essentially the same as IniFileGetValue. To affect the host process, use the function with the hHost notation or machine handle operator. For more information about the machine handle operator and hHost, see Machine handle operator.

If the value or the section is not found, IniFileGetValue returns an empty string ("").

You can get the handle with the SYS_IniFileOpen.

This function is not designed for local access.

You can use SYS_IniFileGetValue with the Open Agent or the Classic Agent. The Open Agent does not allow the ']' character to be part of a section name (the Classic Agent does allow it). Also, with the Open Agent '=' must not be part of a key name. The Classic Agent allows '=' to be part of a key name, but produces incorrect results.

Example

HINIFILE hIni
STRING sValue
hIni = SYS_IniFileOpen ("myapp.ini")
sValue =SYS_ IniFileGetValue (hIni, "Paintbrush", "width")