BrightNail
01-23-2003, 01:14 AM
hey all,
lets see if the gurus can help out on this one.
is there a effective way to do the following:
1. test for the length of 2d arrays to find the one with the greatest length.
2. if the 'other' arrays are less than the greatest arrray in the 2d array, then append the 2d arrays with empty values so that all arrays are equal lenght..ala..
this:
var 2darray = new Array ( new Array ('10','20'), new Array('20','30','35'), new Array('10','15'));
would become:
var 2darray = new Array ( new Array ('10','20','n/a'), new Array('20','30','35'), new Array('10','15','n/a'));
now all subarrays contain 3 elements.
Please keep in mind that the largest subarray could exist anywhere in the Array 2darray...could be the first array, or the last....wherever..
I just need to find out the length of the largest subarray, and make sure the other arrays contain the same length if they are smaller...
any ideas?
james
lets see if the gurus can help out on this one.
is there a effective way to do the following:
1. test for the length of 2d arrays to find the one with the greatest length.
2. if the 'other' arrays are less than the greatest arrray in the 2d array, then append the 2d arrays with empty values so that all arrays are equal lenght..ala..
this:
var 2darray = new Array ( new Array ('10','20'), new Array('20','30','35'), new Array('10','15'));
would become:
var 2darray = new Array ( new Array ('10','20','n/a'), new Array('20','30','35'), new Array('10','15','n/a'));
now all subarrays contain 3 elements.
Please keep in mind that the largest subarray could exist anywhere in the Array 2darray...could be the first array, or the last....wherever..
I just need to find out the length of the largest subarray, and make sure the other arrays contain the same length if they are smaller...
any ideas?
james