|
|
|
Overloading Arrays for multi-dimensional purposes Jul 26, 2002, 09:14 |
990450 |
|
Oh - you mean - without evaluation the names...
Well:
set[0] in one iteration may = 'ECMN'
if you weren't to evaluate it - it would either take set[0] as the value held in it - or the literal of the name... either way - not what we'd want.
BUT - the only reason i'm doing it that way is because i'm generating the arrays automatically.
If you weren't - then you're fine saying:
array['NAME'] = new Array( ARRAYREF1, ARRAYREF2 ... );
where ARRAYREFS are arrays to their own right. That example takes it to a 4th dimension though - i think.
In this example you'd end up - for sure - with array.length as 0. To iterate you'd have to use:
for (name in array)
and in that case name would recieve the literal value NAME - so you'd have to then use: array[NAME] - to pull up the array referenced - and then indexing ( or a second level of naming ) to pull up the 3rd or 4th dimensions respectively.
Flawless
|
|
|
|
|