Automating QTP Test Automation Home Automation Articles Downloads QTP Gotchas Links Books Contact About Site Map
General Function - Set IniThis function writes a value to an .ini file Ini files are great, you can easily edit them without any fear of corrupting anything (unlike the Registry). See also the companion function Get Ini Download it Here (right-click and then save target as). (NOTE - you can just cut & paste from below, but the formatting will have multiple spaces instead of tabs).
'=========================================================================
Sub zGen_SetIni(sIniFile, sSection, sKey, sValue) Dim iRet Extern.Declare micLong, "WritePrivateProfileString", "kernel32.dll", "WritePrivateProfileStringA", micString, micString, micString, micString iRet = Extern.WritePrivateProfileString( sSection, sKey, sValue, sIniFile ) End Sub '========================================================================= |