UnknownWarrior Posted February 29, 2012 Share Posted February 29, 2012 (edited) MsgBox(0,"", $var & " text: " & _GUICtrlListBox_GetText($List1, 0)) Local $var2 = IniReadSection(@ScriptDir & "hey.ini", "asdfg") hey.ini file [asdfg] readme=1 So, my dilemna... I set a Listbox filled with my ini section names when opening the program. All that works fine. But now, I want to read the section name in the .ini that corresponds with the first ListBox item (0 = first line). My debugging MsgBox is correctly returning asdfg for _GUICtrlListBox_GetText($List1, 0), but when I simply do this: Local $var2 = IniReadSection(@ScriptDir & "hey.ini", _GUICtrlListBox_GetText($List1, 0)) It tells me that it cannot read the .ini file (@error). Any ideas why it isn't working when I manually type in asdfg as compared to using the same value found by _GUICtrlListBox_GetText($List1, 0)? Thanks :/ Edited February 29, 2012 by UnknownWarrior Link to comment Share on other sites More sharing options...
UnknownWarrior Posted February 29, 2012 Author Share Posted February 29, 2012 Edit: Fixed -- Reason: _GUICtrlListBox_GetText was returning some whitespace for some reason. So StringStripWS worked like a charm! Link to comment Share on other sites More sharing options...
GordonFreeman Posted February 29, 2012 Share Posted February 29, 2012 Not well understood, but may help: IniReadSection Reads all key/value pairs from a section in a standard format .ini file. IniReadSectionNames Reads all sections in a standard format .ini file. Frabjous Installation Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now