AnsweredAssumed Answered

Count of elements in array?

Question asked by barb8383 on Jan 20, 2019
Latest reply on Jan 21, 2019 by beverly

Sort of a general question:

 

Is there any way to get a count of the number of elements in an array?

 

So if I have:

$blah[1] = "hi"

$blah[2] = "there"

 

is there any way in FMP to find out that there are 2 elements in this array?

 

If not, what's the best way to loop through an array if you don't know how many elements are in it?

 

I tried

set var $greeting = $blah[3]

just to see what happens, but it didn't look like it generated an error I could test for.

 

Thanks.

Outcomes