For..Next--How to count Backwards

  • Thread starter Thread starter Eric Cathell
  • Start date Start date
E

Eric Cathell

I am using an arraylist to process data....the unique problem i have run
into is that if I delete one of the indexed values the arraylist is
reindexed and i get an exception thrown. I need to start at the last item in
the arraylist and go backwards....a for next loop doesnt seem to let me do
this...

for i =arraylist.count-1 to 0
'do stuff here
next

just skips to the loop entirely...any help?

Thanks
 
* Eric Cathell said:
I am using an arraylist to process data....the unique problem i have run
into is that if I delete one of the indexed values the arraylist is
reindexed and i get an exception thrown. I need to start at the last item in
the arraylist and go backwards....a for next loop doesnt seem to let me do
this...

for i =arraylist.count-1 to 0
'do stuff here
next

\\\
For i = MyArrayList.Count - 1 To 0 Step -1
...
Next i
///
 
Back
Top