How can i get value from INI file. I have some constants that need to be fetched at run time.
I used this
hIni = IniFileOpen ("myapp.ini")
sValue = IniFileGetValue (hIni, "Paintbrush", "width")
But its not working... returning empty string.
Does your ini file contain the following:-
If so then it should work fine and return the value 123.... If not then please provide details of YOUR problem, the example given is taken straight out of the help..
The shortest distance between two points is under construction.
Check first by printing HINIFILE.
Is your file placed in valid/project location.
Rest every thing is fine.
[ ] HINIFILE hIni
[ ] hIni = IniFileOpen ("\\pcsjrp1203\TillRSU9.0.0BugFixs&Crs\myapp.i ni")
[ ] Print(hIni)
[ ] string sValue = IniFileGetValue (hIni, "Runtime", "sMachineName")
[ ] Print("INI Content: ", sValue)
[ ] IniFileClose (hIni)
Hi, This is my testcase and the result appears
[ ] H131072
[ ] INI Content:
INI file Path is correct, hIni is returning H131072 and i have a section [Runtime] and sMachineName is a constant string declared as
const STRING sMachineName = "pcsjrp1203" in INI file in [Runtime section]
Is that all right ?
Remove the "Const String" from your *.ini file.
Just write it has..
sMachineName = "pcsjrp1203"
Thanks & Regards,
Its working fine...