determining array lengths

Geoff Canyon gcanyon at inspiredlogic.com
Sat Sep 21 19:39:26 EDT 2002


At 2:11 PM -0500 9/21/02, Brad Allen wrote:
>After looking around in the documentation, I haven't been able to find a simple function to determine the number of keys for a given array dimension. Do I need to parse the output of the keys function for this, or have I overlooked something in the documentation?
>
>I was hoping the number function might do it, as in
>
>     the number of keys in myArray
>
>The expected output would be something like [100,50], to indicate the dimensions of the array.
>
>The "number of lines in the keys of myArray" only works for one-dimensional arrays.
>
>Thanks...


Revolution arrays are associative, so they aren't quite multi-dimensional. That said, you can use the filter command to get a count of just the elements of the array you want. Details at: 

<http://macitworks.com:8080/revdocs/aboutAssociativeArrays>
-- 

regards,

Geoff Canyon
gcanyon at inspiredlogic.com



More information about the use-livecode mailing list