Page 1 of 1

Array Oddity

Posted: Wed Aug 12, 2009 8:09 pm
by chris9610
I do not understand this, but this script puts the array keys into the field in this order:

9,8,1,2,3,4,5,6,7

You need a button and a multi line field for this script.

Code: Select all

on mouseUp
   repeat with i = 1 to 9
        repeat with j  = 1 to 9
         put "test data"&&j into ttvar[i][j]
      end repeat
   end repeat
   put keys of ttvar into tkey
   put tkey into fld "fld1"
end mouseUp
Can anyone explain this? I expected them to go in the field in the same order as creation.

Posted: Wed Aug 12, 2009 8:18 pm
by massung
Arrays aren't really arrays (in Rev). They are hash tables. The keys are hashed can can appear - pretty much - in any order.

http://en.wikipedia.org/wiki/Hash_table

Jeff M.