July 10th, 2003, 03:50 PM
for each loop, grab next item
for each item in A
is there a way in this loop to grab item, do arithmatic, then grab the next element in the array without going through the loop agian? I want to do 2 at a time and just thought it would be nicer if there was a way rather than having to deal with an integer and checking whether it was odd or even...
July 10th, 2003, 03:59 PM
For cnt = 0 To 10
val1 = ary(cnt)
cnt = cnt + 1
If cnt <= 10 Then
val2 = ary(cnt)
MsgBox "Val(" & (cnt - 1) & ") = " & val1 & vbCrLf _
& "Val(" & cnt & " = " & val2
July 10th, 2003, 07:07 PM
dear onslaught's help desk...
Yea, after seeing that i feel kinda stupid, there's an array length attribute isn't there.... damnit
i was thinking i had to use for each X in ARRAY, but i guess an even easier what would be the
FOR cnt 0 to array.length-1
I did a split on a 2 column comma separated excel cvs file, so they'll always be in pairs
but in anycase, i guess that means there isn't a way to do
Array(item+1) for the FOR EACH method then huh?