bendev
04-12-2005, 06:27 PM
Hello,
I load a 2 dimensions javascript Array from an API. Let's say the array is called tab_int.
So, first, there are declarations like :
tab_int new = Arrray() ;
tab_int['x'] = new Array() ;
So I mean that :
_ tab_int['x'] is an associatif Array
_ tab_int is a 2 dimensions array - and even 2 dimensions associatif, because of the way I use it ...
So there are some functions using this tab without problems with some tab_int['x']['z'] - actually 'x' and 'z' are in variables most part of the time
Apart from one function ... of course (!), the function where I need to browse the entire table :
for ( var myInt in tab_int['x'] ) {
if (tab_int['x'][myInt] != '' ) {
// processing
}
}
I have some really funny results, not stable, not secure, which makes me wonder if I'm on the good way !
Sometimes I can go inside the loop (the first time, for example) but then I can't ... ?
So : does that work ? is there something to re-initialize ? does anyone of you can make this kind of things work ?
Thank you by advance for any clue ...
Ben
I load a 2 dimensions javascript Array from an API. Let's say the array is called tab_int.
So, first, there are declarations like :
tab_int new = Arrray() ;
tab_int['x'] = new Array() ;
So I mean that :
_ tab_int['x'] is an associatif Array
_ tab_int is a 2 dimensions array - and even 2 dimensions associatif, because of the way I use it ...
So there are some functions using this tab without problems with some tab_int['x']['z'] - actually 'x' and 'z' are in variables most part of the time
Apart from one function ... of course (!), the function where I need to browse the entire table :
for ( var myInt in tab_int['x'] ) {
if (tab_int['x'][myInt] != '' ) {
// processing
}
}
I have some really funny results, not stable, not secure, which makes me wonder if I'm on the good way !
Sometimes I can go inside the loop (the first time, for example) but then I can't ... ?
So : does that work ? is there something to re-initialize ? does anyone of you can make this kind of things work ?
Thank you by advance for any clue ...
Ben