How to Display Items in an INI file and Allow for User Selection
Keywords: IniItemizePvt AskItemList IniReadPvt
Question:
Is it possible to read a section of an ini file and display the contents of what is to the right of the equal sign as the result in an ItemBox. And letting the user select one of the displayed options. I have been able to display what is to the left of the equal sign with the IniItemizedPvt Function. Any help you can provide is greatly appreciated.Answer:
Yes, but you have to do an IniReadPvt for each for the keys that IniItemize returns and build your own string to display.In the example below, note that you will need to provide the full path to your INI file, if it is not located in the \Windows or \Windows\System subdirectory. Otherwise, the function will return a null string since it can't find the INI file.
So your script would look something like...
inifile="www-prod.ini" iniall=IniItemizePvt("",inifile) ; Get sections in win.ini inisection=AskItemList("Choose a section",iniall,@tab,@sorted,@single) inikeywords=IniItemizePvt(inisection,inifile) inicount=ItemCount(inikeywords,@tab) line="" for xx=1 to inicount inicurrent=ItemExtract(xx,inikeywords,@tab) inivalue=IniReadPvt(inisection,inicurrent,"???",inifile) line=strcat(line,inicurrent," = ",inivalue,@tab) next AskItemList("The Ini Section",line,@tab,@sorted,@single)
Article ID: W13334Filename: Display Items in an INI file in an Itembox.txt