Question regarding arrays...
Richard Gaskin
ambassador at fourthworld.com
Thu Dec 30 16:18:55 EST 2004
Lynch, Jonathan wrote:
> I thought I read in past postings that Rev did not support 3D arrays -
> that it only supported up to 2D arrays.
>
> This morning I tested that, and seemed to have no problem with 3D
> arrays. I am sure I am just making an ignorant mistake - either in my
> testing or in what I gathered from the postings I read - but could
> someone clarify the issue?
The issue is with "2D" and "3D" nomenclature, which can be misleading
when trying to understand working with arrays in Rev.
Rev currently uses associative arrays, which allow a string to be a
label associated with a data element.
That label string can be numeric giving you ordered elements, and can
can include commas to give you some of the convenience of
multi-dimensional arrays.
Just remember it's always a string: myArray[1,2] is the same as
myArray["1,2"].
Associative arrays are flexible, useful in a great many circumstances
that indexed arrays might be harder to work with.
There is a request in Bugzilla for fully-dimensional indexed arrays, and
that'll be nifty when it's there, but in the meantime hopefull
associative arrays will continue doing what you need.
--
Richard Gaskin
Fourth World Media Corporation
__________________________________________________
Rev tools and more: http://www.fourthworld.com/rev
More information about the use-livecode
mailing list