the keys of myArray
jbv.silences at club-internet.fr
Fri Sep 8 10:01:40 CDT 2006
> There may be other ways to handle this, although if using the built-in
> sort command will do what you need it's reasonably efficient. It's only
> one line of code -- was it causing a problem in your script?
it's not causing any problem in my script.
again, I was just wondering about any logic behind the keys order...
actually, there's only 1 situation I can imagine in which it could be
useful to know in advance in which order keys would be output :
in heavy math treatments with loops in which arrays values & keys
are needed for further processing, many lines of code (sort commands)
would be saved and scripts sped up significantly...
BTW here's a suggestion for a slight improvement of the "keys" function :
get the numKeys of myArray --> outputs the keys in numeric order
get the alphaKeys of myArray --> outputs the keys in alphabetic order
More information about the use-livecode