I wanted to know if there is any other shortcut or command available instead of looping thru.
NewBox(0).Status="Good"
NewBox(1).Status="BAD"
NewBox(2).Status="GOOD"
NewBox(3).Status="Empty"
NewBox(4).Status="Empty"
ProcessNewBox(NewBox, 0)
....
Sub ProcessNewBox(ByVal NewBox() As Box, ByVal Index As Long, ByVal Size As Long)
' process NewBox(Index)
' check some end condition to avoid infinite calls
' clear the current slot or - better - find out next status
NewBox(Index).Status = "Empty"
....
' increment index (ring)
Index = (Index + 1) Mod Size
' call recursively same function
ProcessNewBox(NewBox, Index, Size)
End Sub
the alternate way to loops is recursion.
like a queue could be useful
just taking away from the collection will automatically bring the next one to the top for processing. No looping or recursion.