I'm pretty happy with the idea that Livecode Arrays are actually associative arrays, but I'm wondering if you can access them by index, rather than key?
I want to put 5 strings in to an array, so all I know how to do so far is
put "fred" into myArray[1]
put "wilma" into myArray[2]
put "barney" into myArray[3]
put "betty" into myArray[4]
put "dino" into myArray[5]
This creates me my array, and I can iterate it thru it by declaring a variable and incrementing it in a loop, accessing it with myArray[index]
In this case though, it feels to me like this is still doing a keyed lookup, and not using the index to refer to a position within the array.
Where this really hurts me is when I do
delete variable myArray[3]
Sure enough, barney gets deleted, and my array now thinks there are 4 items in it. So, if I asked for the third member of the array again, coming as I do from a Java / C background, I'd expect to get "betty" - but I don't - I get nothing, as the is now no member of the array keyed by "3"
So, can I access the array by index, or do I always have to go for a keyed retrieval?