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