Phaser Posted October 15, 2011 Share Posted October 15, 2011 (edited) Hi everyone I am using _ArrayFindAll to gather a set of values, this works fine I now want to loop through that set of results to get the values from the indexes at certain positions, heres my result from arrayfindall [0]|1 [1]|3 [2]|6 [3]|7 [4]|9 [5]|10 [6]|11 [7]|12 [8]|14 [9]|15 [10]|17 I am trying to locate the following, 1 value on its own, which would be index [0] the 1 as the next index is not a sequential number (not 2, its a 3) this one is easy as I use ;find last single $sequencehistory[$i][0] = $a[0] Now I don't get what I expected, I am now looking for 2 sequntial values, IE 3,4 or 8,9 in the above case it is indexes [2] & [3] which are 6 & 7 This is what I came up with but its not working $j = 0 Do ;find last double If $a[$j]+1 = $a[$j+1] Then $sequencehistory[$i][1] = $a[$j] $j = 119; if we find 2 in a row get out of here EndIf $j = $j+1 Until $j = 120 Or UBound($a)-1 Lastly, I am looking for 3 in a row (9,10,11 in the above data set) using this in the same Do loop If $a[$j]+1 = $a[$j+1] And $a[$j]+2 = $a[$j+2] Then I hope its a simple thing I am overlooking and I hope I have explained it well enough for someone more experienced to see the error/s Many thanks in advance Edit; sorry should have said for the 2 seq I want the value of the index that starts the seq and the 3 seq also the start value of the index it was found at Edited October 15, 2011 by Phaser Link to comment Share on other sites More sharing options...
Phaser Posted October 16, 2011 Author Share Posted October 16, 2011 Issue solved, it appears I can't run a Do loop within another Do loop, the above 3 Do loops were running within one main Do loop, I have solved it by changing the Do loops to While loops and it all works as expected now. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 16, 2011 Moderators Share Posted October 16, 2011 Phaser, it appears I can't run a Do loop within another Do loopOf course you can: $i1 = 0 ConsoleWrite("Loop 1 = " & $i1 & @CRLF) Do $i2 = 0 Do $i2 += 1 ConsoleWrite(@TAB & "Loop 2 = " & $i2 & @CRLF) Until $i2 = 3 $i1 += 1 ConsoleWrite("Loop 1 = " & $i1 & @CRLF) Until $i1 = 3 You might not be able to, but that is a problem in your coding - not one of AutoIt's making. 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