I setup a ini file like:
used the following code:
HINIFILE hIniFile = IniFileOpen ("c:\test.ini");
string sValue = IniFileGetValue (hIniFile, "Section-1", "//a");
this would return a value of v1. If I used "#a" in the name parameter, it would return a value of v2. if I used "a" in the name parameter, it would return a value of 1 and ignore the 2nd "a=" in the ini file.
INI files are not a Segue/SilkTest created thing. They're a standard Windows (perhaps rooted in Unix) file format. I've been familiar with the format for so long that I am definitely NOT a good tester of Segue's documentation from a newbie's perspective. I did a quick search in Win2K's Help but didn't find much there to help, but I'm sure more beginner-level info is available somewhere.
Everything in the previous response is as it should be.
Why would you want two a= lines anyway? Perhaps you might want the same variable (a) defined in different sections [section] of the file (I do this), but in the same section it makes no sense.
If you're trying to comment something out, I believe that you use a semi-colon at the beginning of the line. For example, in the ini file:
In the above, if you use "a" as the value to get in IniFileGetValue, "3.15" will be returned. If you try to get ";a" nothing will be returned because, technically, that value doesn't exist in the .ini file; it's commented out.