determining array lengths
BradAllen at mac.com
Sat Sep 21 18:09:01 CDT 2002
> > 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?
>See the extents function.
Aha. Thank you. I had misunderstood the wording of this function in
the Transcript dictionary. The part that threw me off was this part
of the at the end of the entry under Extents:
"Each line contains two numbers separated by commas. The first item
is the smallest number of an element in that dimension, and the
second item is the largest number."
Is this misleading, or am I just misunderstanding this text? My
reading of this is that Extents provides the lowest and highest
values in the Elements of an array (sort of like the min and max
functions), not the index keys. But in reality, as I'm glad to learn,
the Extents function provides the lowest and highest values of the
index keys in an array dimension.
More information about the use-livecode