SYS_IniFileSetValue Function

Action

Changes a value in an open initialization (.ini) file on the target machine.

Syntax

SYS_IniFileSetValue (hIniFile, sSection, sName, sValue)
Variable Description
hIniFile A handle to the file containing the value. HINIFILE.
sSection The section of the file containing the value to change. STRING.
sName The name of the value to change. STRING.
sValue The new value. STRING.

Notes

SYS_IniFileSetValue is executed by the Agent process, not the Silk Test Classic process; but it is essentially the same as IniFileSetValue. 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 specified section or value does not exist, SYS_IniFileSetValue adds it.

SYS_IniFileSetValue does not write the initialization file to disk; it only changes or adds a value in the open file. All set actions (such as SYS_IniFileSetValue) are written to the .ini file when SYS_IniFileClose is invoked.

This function is not designed for local access.

Example

HINIFILE hIni
hIni = SYS_IniFileOpen ("myapp.ini")
SYS_IniFileSetValue (hIni, "Paintbrush", "width", "640")