Dividing array into sections
2004-02-16 - By Helmut
Back counters = new Array();
counters = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16];
Goal:
Divide Array into groups of 5 dynamically since the array will be
populated from XML
Accomplished so far:
loop = Math.round((counters.length/5))
for (i = 0;i <loop;i++)
{
for ( j = 0 ; j < (loop*5);j++)
{
trace(counters[j-5]);
}
};
The above gives me the wrong answer that I am looking for.
What would be the best approach for this? Pointers? Suggestions. Thanks!
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
Supported by Fig Leaf Software
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
Be sure to check the archives and the wiki:
http://chattyfig.figleaf.com/
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
http://chattyfig.figleaf.com/cgi-bin/ezmlm-cgi?1:mss:104310
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
To unsubscribe send a blank e-mail to:
Normal Mode: flashcoders-unsubscribe@(protected)
Digest Mode: flashcoders-digest-unsubscrive@(protected)
|
|