Dreu Posted September 8, 2010 Share Posted September 8, 2010 (edited) Alright so I'm a writing little tool that will help me keep track of things... Got an issue though that I've been toying with for about an hour now. Func _UpdateSearch() $Players_List_Array = IniReadSectionNames($Players_Ini) If @Error Then MsgBox(0, "Error", "1 : "&@Error); This isn't triggered. Else GuiCtrlSetData($players_list, "") For $i = 1 To $Players_List_Array[0] GuiCtrlCreateListViewItem($Players_List_Array[$i], $Players_List); This doesn't add the value to the listview. If @Error Then MsgBox(0, "Test", @Error); This isn't triggered either. EndIf Next EndIf EndFunc I've been abusing the forums search feature to find a previous topic in relation. I found a few, but those wanted the values of the section as well... thus requiring a double nested loop and the help of UBound()... I only want the section name to be displayed, so after reviewing the helpfile and hunting the forums for the last hour... I've come to believe that IniReadSectionNames() used in conjunction with a simple For $i = 1 To $array[0] look should do exactly what I need... But my logic is obviously failed somewhere, or I wouldn't be posting this in shame XD. This is only a very small part of the script as a whole... but all in all, its fairly complete in regards to its sole intentions. Only part of this function not quite shown is where I declared $Player_List as the GUICtrlCreateListView. Any help would be much appreciated =( What I've done so far: Massive about of time spent scripting error checks after error checks... It never triggers an error, but it never displays the listview O_O. I've searched, found, and tested examples in the helpfile... and they worked... but after trying to modify them in a way that would suit my need, I'm back at sqaure #1. Bang my head against the desk a few times Try again. ---------- Wits end =/... and possibly on the verge of a concussion. Edited September 8, 2010 by Dreu Link to comment Share on other sites More sharing options...
Dreu Posted September 8, 2010 Author Share Posted September 8, 2010 Just realized I have a GuiCtrlSetData($listview, "") ... right before it GuiCtrlSetData()'s. However, theres currently only 1 section in the ini file for testing... so in the logical order its currently scripted in, it would still display the single value, right? ( Browser incompatibility or I would use the Edit button, sorry. ) Link to comment Share on other sites More sharing options...
Dreu Posted September 8, 2010 Author Share Posted September 8, 2010 Bump. I still haven't been able to figure it out =(. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 8, 2010 Moderators Share Posted September 8, 2010 Dreu, First, please do not bump your posts within 24 hours. Remember this is not a 24/7 support forum - those who answer are only here because they like helping others and have some time to spare. You just have to wait until someone who knows something about your particular problem, and is willing to help, comes online. Be patient and someone will answer eventually. Like this Your function works just fine when I test it with the following in the ini file: [Tom] [Dick] [Harry] Using your ini file, does the following code fill the listbox: #include <GUIConstantsEx.au3> $Players_Ini = "Your_Ini_path" $hGUI = GUICreate("Test", 500, 500) $Players_List = GUICtrlCreateListView("Player", 10, 10, 200, 200) $hButton = GUICtrlCreateButton("Load", 10, 400, 80, 30) GUISetState() _UpdateSearch() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $hButton _UpdateSearch() EndSwitch WEnd Func _UpdateSearch() $Players_List_Array = IniReadSectionNames($Players_Ini) If @Error Then MsgBox(0, "Error", "1 : "&@Error); This isn't triggered. Else GuiCtrlSetData($players_list, "") For $i = 1 To $Players_List_Array[0] GuiCtrlCreateListViewItem($Players_List_Array[$i], $Players_List); This doesn't add the value to the listview. If @Error Then MsgBox(0, "Test", @Error); This isn't triggered either. EndIf Next EndIf EndFunc If not, what error do you get? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area 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