kjbopp Posted December 19, 2007 Share Posted December 19, 2007 I need to display every other result in an array, i.e. my array consists of: [1][0] = "xxx" [1][1] = "yyy" [1][2] = "xxx" [1][3] = "yyy" ...and I just want either all the "x's" or all the "y's" or every other value This is the snippet that displays the array For $i = 1 To $NumofCols $s = $s & $array[1][$i-1] & @CRLF Next MsgBox(4096, "Array", $s) Not sure how to manipulate the second element of the array. Thanks in advance for any advice. Link to comment Share on other sites More sharing options...
PsaltyDS Posted December 19, 2007 Share Posted December 19, 2007 You can do that like this: $iStart = 0 ; Read even For $i = $iStart To UBound(, 2) - 1 Step 2 $s &= $array[1][$i] & @CRLF Next $s &= @CRLF $iStart = 1 ; Read 0dd For $i = $iStart To UBound(, 2) - 1 Step 2 $s &= $array[1][$i] & @CRLF Next $s &= @CRLF MsgBox(4096, "Array", $s) Merry Christmas! Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
kjbopp Posted December 19, 2007 Author Share Posted December 19, 2007 Beautiful!!! Thanks and Merry Christmas, and Happy Holidays, and Happy Hanukkah, and Happy Kwanzaa... 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