Fair point, Corn, and it re-enforces the idea that it's worth understanding
the logic involved in dealing with lists in order to fully appreciate the
beauty of functions like GetValue() or List().


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 Corn Walker
Sent: Monday, March 31, 2008 10:00 AM
To: [email protected]
Subject: Re: Getting the Count....

On Mar 31, 2008, at 12:46 PM, John Weinshel wrote in part:

>
> 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 )


Except if your list of values is the result of culling values with  
the LeftValues(), MiddleValues(), or RightValues() functions, you  
will find that there is already a carriage return appended to the  
list. This will cause the above expression to return one more value  
than is present in the text. This makes a cumbersome calculation  
formula even more so:

PatternCount( $variable; "¶" ) + Case( not IsEmpty( $variable ) and  
Right( $variable; 1 ) <> "¶"; 1 )

Compare that to the elegance of ValueCount( $variable ) and perhaps  
you'll understand why it instantly became one of my favorite  
functions, coupled with GetValue() in FMP 8.

Corn Walker
The Proof Group
http://proofgroup.com/

Reply via email to