getting count of array with non-integer index
janschenkel at yahoo.com
Sat Aug 10 03:03:01 EDT 2002
As you haven't gotten a reply yet on the list, I
figured I'd have a stab at it :-)
First of all, you are setting up the arrays correctly,
so no worries there.
To answer your second question, you have a few
options, depending on the circumstances.
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
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.
"As we grow older, we grow both wiser and more foolish
at the same time." (De Rochefoucald)
--- Trevor DeVore <trevor at mangomultimedia.com> wrote:
> I have an array created from a db query that looks
> similar to this:
> I want to loop through these results but have been
> unable to find a way to determine how many elements
> are in the first dimension of the array. I saw the
> extents function but that only works with numeric
> keys. I would like to keep the non-numeric keys if
> possible in order to make my code more readable.
> So my questions are 1) Am I setting up arrays
> correctly in transcript and 2) If so, how do I get
> the count of the first dimension for looping
> Trevor DeVore
> Blue Mango Multimedia
> trevor at mangomultimedia.com
> use-revolution mailing list
> use-revolution at lists.runrev.com
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
More information about the Use-livecode