jockmahon01
asked on
Arrrays problem
i have this code, bacausally i have a big array of items and i want to seperate it down into an array or arrays so instead of having an array with 97 items i would have an array with 5 items each is an array with a max of 20 items
index 0 - 20 items (0- 19)
index 1 - 20 items (19 - 40)
index 2 - 20 items (41 - 60)
index 3 - 20 items (61 - 80)
index 4 - 20 items (81 - 97)
this code works if i just put a simlpe value in ie
seperateItemsArray[itemInd ex][h]= i ;
but if i try to put in a array
seperateItemsArray[itemInd ex][h]= details[i] ;
it just goes blank
help
index 0 - 20 items (0- 19)
index 1 - 20 items (19 - 40)
index 2 - 20 items (41 - 60)
index 3 - 20 items (61 - 80)
index 4 - 20 items (81 - 97)
this code works if i just put a simlpe value in ie
seperateItemsArray[itemInd
but if i try to put in a array
seperateItemsArray[itemInd
it just goes blank
help
var itemsArray:Array = new Array();
var seperateItemsArray:Array = new Array();
var itemIndex:Number= 0;
var h=0;
seperateItemsArray[itemIndex] = new Array();
for(var i:Number = 0 ; i < details.length ; i++)
{
if(h < 20)
{
//seperateItemsArray[itemIndex][h] = new Array();
seperateItemsArray[itemIndex][h]= details[i] ;
h++;
}
else
{
h = 0;
itemIndex++;
seperateItemsArray[itemIndex] = new Array();
}
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER