determining array lengths

Jan Schenkel janschenkel at yahoo.com
Sat Sep 21 16:21:01 EDT 2002


Hi Brad,

I looked into this a while ago. My solution was:

1) If the second dimension is fixed (always NN
elements), you can suffice by saying:
  put (the number of lines of the keys of tArray / NN)

2) If however NN is variable, you can get it with the
following trick:
  put the keys of tArray into tKeys
  split tKeys using return and comma
  put the number of lines of the keys of tKeys

I know it looks convoluted, but it works, even if the
second dimension varies.

Hope this helped,

Jan Schenkel.

(You can find the entire thread at the URL:
http://lists.runrev.com/pipermail/use-revolution/2002-August/006786.html
)


--- Brad Allen <BradAllen at mac.com> 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...
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
>
http://lists.runrev.com/mailman/listinfo/use-revolution


__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com



More information about the Use-livecode mailing list