Does anyone know how to do a single tread iteration.
For example I have the following array: ("dog", "cat", "mouse", "bird")
I need to go through the array in such a way that it picks up each object once through the first run and then return to the beginning again and pick up the first two.
Let's say I need 6 objects returned. The result should therefore be:
dog
cat
mouse
bird
dog
cat...
Or if I need just 5 objects returned, the result set would be
dog
cat
mouse
bird
dog
I tried to put a loop within a loop but that just returns the entire set multiple times. This is not what I want exactly.
I want it to go through the entire array. When it reaches the last object in the array, I want it to go back to the first object and continue through.
Does anyone have any ideas?
Thanks, any help would be appreciated.
For example I have the following array: ("dog", "cat", "mouse", "bird")
I need to go through the array in such a way that it picks up each object once through the first run and then return to the beginning again and pick up the first two.
Let's say I need 6 objects returned. The result should therefore be:
dog
cat
mouse
bird
dog
cat...
Or if I need just 5 objects returned, the result set would be
dog
cat
mouse
bird
dog
I tried to put a loop within a loop but that just returns the entire set multiple times. This is not what I want exactly.
I want it to go through the entire array. When it reaches the last object in the array, I want it to go back to the first object and continue through.
Does anyone have any ideas?
Thanks, any help would be appreciated.