Behind the newer ValueCount() function Jason quite rightly suggests is the
idea that, in a return-delimited list, you count the list items by counting
the returns, and then adding one, i.e., the spaces between the pickets in a
picket fence. The 'adding one' part should really be a Boolean test for the
existence of the fence in the first place.

To count the returns, you can use the PatternCount() function:

PatternCount ( $Variable; "¶")

...and to test for the existence of the fence:

not IsEmpty ( $Variable )

...making your total:

PatternCount ( $Variable; "¶") + not IsEmpty ( $Variable )

That is all a lot less elegant than ValueCount(), which hides the underlying
logic, but understanding the logic can be useful in solving similar problems
down the road.


John Weinshel
Datagrace
Vashon Island, WA
(206) 463-1634
Member, FileMaker Business Alliance
Certified For FileMaker 8
Certified For FileMaker 7

-----Original Message-----
From: FileMaker Pro Discussions [mailto:[EMAIL PROTECTED] On
Behalf Of Jason L DeLooze
Sent: Monday, March 31, 2008 9:29 AM
To: [email protected]
Subject: Re: Getting the Count....

ValueCount( $Variable )


On 3/31/08 at 10:22 AM -0600, Chuck Pelto wrote:
> ....of items in a $Variable.
> 
> Pouring over the documentation and not finding anything appropriate, how
does one get the number of items-separated by lines-in a ScriptMaker
variable?
> 
> E.g., $Variable has these items in it....
> 
> Dog¶Cat¶Chicken¶Fish
> 
> There are four items in $Variable.
> 
> Is there a call or function that will allow me to identify there are four
items in $Variable? I can't seem to identify it in the documentation.
> 
> Regards,
> 
> Chuck

Reply via email to