RagnaroktA Posted May 14, 2007 Share Posted May 14, 2007 Okay, so I know that this is a simple fix, I just cant for the life of me figure it out. Someone point me in the right direction... Func _ListFiles($sPath) Local $aFileList, $i = 1 $aFileList = _FileListToArray($sPath, "*", 1) If @error = 1 Then MsgBox(48, $sTitle, "No files were found in the directory specified." & @CRLF & @CRLF & $sPath) Exit Endif For $i = 1 To $aFileList[0] $lvFilesItem = GUICtrlCreateListViewItem($i & "|" & $sPath & "|" & StringStripCR($aFileList[$i]), $lvFiles) ; If $lvEven Then ; $lvEven = 0 ; Else ; $lvEven = 1 ; GUICtrlSetBkColor($lvItem, $GUIBkColor) ; EndIf Next ; _ArrayDisplay($aFileList, "$FileList") EndFunc; ==> _ListFiles The above function is supposed to populate a list view with the information returned by _FileListToArray. It does that, but it wont stop. It continually cycles through, re-adding the same array to the list view. What did I do wrong? I cant see the error in the logic, and everything I've tried left me with the same situation. Any help is greatly appreciated. Current Projects:Remote Administration Suite Updated! 12-20-07Remote User State Migration Tool (Plugin) Updated! 12-20-07Batch Print Wizard Updated! 12-20-07Links:AutoIt Beta | AutoIt Wiki Link to comment Share on other sites More sharing options...
Zedna Posted May 14, 2007 Share Posted May 14, 2007 You are probably calling Func _ListFiles() in some cycle and there is error in your logic (outside this function) Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
RagnaroktA Posted May 14, 2007 Author Share Posted May 14, 2007 You are probably calling Func _ListFiles() in some cycle and there is error in your logic (outside this function)The problem is inside this function, not outside. Current Projects:Remote Administration Suite Updated! 12-20-07Remote User State Migration Tool (Plugin) Updated! 12-20-07Batch Print Wizard Updated! 12-20-07Links:AutoIt Beta | AutoIt Wiki Link to comment Share on other sites More sharing options...
enaiman Posted May 14, 2007 Share Posted May 14, 2007 The best way to see what your script is doing is to trace its execution - you can use the option "Add Trace Lines" from SciTE/Tools menu and see what your script is doing. There is no obvious reason inside this function to make it to repeat the for-next cycle over and over so, as Zedna said, the error should be outside (a While or a Do statement maybe or a "bad placed" Return) SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script wannabe "Unbeatable" Tic-Tac-Toe Paper-Scissor-Rock ... try to beat it anyway :) Link to comment Share on other sites More sharing options...
GaryFrost Posted May 15, 2007 Share Posted May 15, 2007 The problem is inside this function, not outside. I would have to agree with Zedna on this, I see no problem with the function itself. SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. 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