I have some code that loops through an array.
The code looks like:
Forall tracknum In arraytracknum
…
End Forall
Is there a similar way to go from element to element in REVERSE? Starting at the end, go to element 0?
I would appreciate any thoughts you may have.
Subject: Forall through an array IN REVERSE?
for x = ubound(arrayname) to lbound(arrayname) step -1 ’ do stuff with arrayname(x)
next
Subject: Forall through an array IN REVERSE?
Of course, just do the logic backwards. Instead of incrementing in your loop, decrement, and be sure to start from the UBound of your array and go down.
–
The website for Ben Poole, a UK-based software developer, IT consultant, and director of the legacy application data specialists, LDC Via Ltd.