John Luther
New Member
- Joined
- May 5, 2014
- Messages
- 28
Hi All,
Suppose I have an array such as this one, with a schedule of fruits and quantities:
A Orange 3
B Banana 1
C Banana 1
D Orange 1
E Banana 1
F Orange 1
G Banana 3
H Banana 3
I Orange 2
But I'd like to "sort" it this way, so that I keep the sort order until a fruit reaches a qty of 3, and then no more of that fruit is included until the other fruit has reached a qty of 3.
A Orange 3
B Banana 1
C Banana 1
E Banana 1
D Orange 1
F Orange 1
G Banana 3
I Orange 2
H Banana 3
Sorry for the convoluted example. I hope it gets the point across. What I've tried so far and what I would like to do is pull the list into a 2d array and loop through the list populating another array. None of my attempts have been successful enough to describe.
Anyone have any suggestions?
Thanks
Suppose I have an array such as this one, with a schedule of fruits and quantities:
A Orange 3
B Banana 1
C Banana 1
D Orange 1
E Banana 1
F Orange 1
G Banana 3
H Banana 3
I Orange 2
But I'd like to "sort" it this way, so that I keep the sort order until a fruit reaches a qty of 3, and then no more of that fruit is included until the other fruit has reached a qty of 3.
A Orange 3
B Banana 1
C Banana 1
E Banana 1
D Orange 1
F Orange 1
G Banana 3
I Orange 2
H Banana 3
Sorry for the convoluted example. I hope it gets the point across. What I've tried so far and what I would like to do is pull the list into a 2d array and loop through the list populating another array. None of my attempts have been successful enough to describe.
Anyone have any suggestions?
Thanks