[quote=384663:@Dave S]
for i=0 to Array0.ubound
select case i
case 0...19
array1.append array0(i)
case 20...29
array2.append array0(i)
....
end Select
next i
like that?[/quote]
I think thats the idea, but the array sometimes have 300 sometimes 500 sometimes 1000.
I’ll gonna try to divide the number of elements to 20
dim x=ceil(array0.ubound/20)
for i=0 to Array0.ubound
select case i
case 0...x
array1.append array0(i)
case x+1 to 2*x
array2.append array0(i)
....
case >= (19*x)+1
array20.append array0(i)
end Select
next i
may not be 100% syntax correct… but thats the idea.
It looks like I understand the goal differently. I think what he needs:
go from 1 array to 20
have between 200 and 300 elements in the 1 array, not exact number
create 20 arrays with same number of elements
Maybe it will work if you:
get a value of Array0.Ubound / 20
use the whole part (maybe add 1 to that)
do the for i=0 to Array0.Ubound and check if i / value is less than 1, then put that in array1, if it is 1.0 and less than 2, put in array2
Edit: Dave is fast answering and helping, thanks. I think is easier to look at his code than trying to make sense of what I wrote (even if they are the same idea)
for i=0 to array0.ubound
indx=i mod 20
select case indx
case 0
array1.append array0(i)
case 1
array2.append array0(i)
....
case 19
array20.append array0(i)
end select
next i
[quote=384683:@Dave S]for i=0 to array0.ubound
indx=i mod 20
select case indx
case 0
array1.append array0(i)
case 1
array2.append array0(i)
…
case 19
array20.append array0(i)
end select
next i[/quote]
Men you are a Genius
So in this case the Main Array has 2,877 elements
and was spliced to the 20 arrays.