Realm Posted April 15, 2010 Posted April 15, 2010 Another Noob oversight I'm sure, but I'd appreciate the help. This is not the entire code, only a snippet of where I believe the loop is. It pulls a list of items into a listview, problem is that it loops the first column, only, infinitely. Thanks in advance. If Not _FileReadToArray("Test_Collection.csv",$collRecords) Then MsgBox(4096,"Error", " Error reading log to Array error:" & @error) Exit EndIf While 1 For $i=1 To UBound($collRecords)-1 $split = StringSplit($collRecords[$i], ",", 1) _GUICtrlListView_AddItem($ListView1, $split[1]) _GUICtrlListView_AddSubItem($ListView1, $i-1, $split[2], 1) _GUICtrlListView_AddSubItem($ListView1, $i-1, $split[3], 2) _GUICtrlListView_AddSubItem($ListView1, $i-1, $split[4], 3) _GUICtrlListView_AddSubItem($ListView1, $i-1, $split[5], 4) _GUICtrlListView_AddSubItem($ListView1, $i-1, $split[6], 5) _GUICtrlListView_AddSubItem($ListView1, $i-1, $split[7], 6) If @error = -1 Then ExitLoop Next Wend FileClose($file) While 2 Sleep(100) WEnd My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry.
kaotkbliss Posted April 15, 2010 Posted April 15, 2010 While 1 <-- first loop (and infinate) For <-- 2nd loop Then ExitLoop <-- exits to the while 1 loop 010101000110100001101001011100110010000001101001011100110010000 001101101011110010010000001110011011010010110011100100001 My Android cat and mouse gamehttps://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek We're gonna need another Timmy!
Realm Posted April 15, 2010 Author Posted April 15, 2010 While 1 <-- first loop (and infinate) For <-- 2nd loopThen ExitLoop <-- exits to the while 1 loopOuch...I forgot to take out the while loop when i changed the script....Thanks My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry.
Fi0da Posted April 16, 2010 Posted April 16, 2010 While 1 <-- first loop (and infinate) For <-- 2nd loopThen ExitLoop <-- exits to the while 1 loopHmmm...then doubt 1:then can i write several Whiles?For ex...While1 ; While2...for the same function??/Doubt2 : If 1 = ok, Then all Whiles must have Wend?Tkx alot. I read ... I update ... I learn ...
Moderators Melba23 Posted April 16, 2010 Moderators Posted April 16, 2010 Fi0da,You can nest as many While...WEnd loops as you want. And you can set each one as While 1 if you wish - although it might be a good idea to differentiate if you can. But it is up to you to make sure you can get out of the loops once you have entered them! Play with this a bit: expandcollapse popupHotKeySet("1", "Exit_1") HotKeySet("2", "Exit_2") HotKeySet("3", "Exit_3") Global $fExit_1 = False, $fExit_2 = False, $fExit_3 = False While 1 MsgBox(0, "", "In Loop 1") If $fExit_1 = True Then ExitLoop While 2 MsgBox(0, "", "In Loop 2") If $fExit_2 = True Then ExitLoop While 3 MsgBox(0, "", "In Loop 3") If $fExit_3 = True Then ExitLoop WEnd WEnd WEnd Func Exit_1() $fExit_1 = True EndFunc Func Exit_2() $fExit_2 = True EndFunc Func Exit_3() $fExit_3 = True EndFuncM23 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
Fi0da Posted April 19, 2010 Posted April 19, 2010 very Interesting Tkx I read ... I update ... I learn ...
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