2 Replies Latest reply on May 11, 2015 7:42 AM by philmodjunk

    pattern count

    karen_joy

      Title

      pattern count

      Post

      Hi All,

      When do we used pattern count like below.

      PatternCount ( $layout ; "List" ) 

       

      Thanks

       

       

        • 1. Re: pattern count
          schamblee

          PatternCount - will count the number of occurrences of the search string that is in the text.   In your example the word "List" would be searched in the variable $layout and display the number of times List appears in that variable. 

          • 2. Re: pattern count
            philmodjunk

            Example:

            PatternCount ( "AppleOrangeKiwi" ; "Apple" )

            will return the value 1 because the text "apple" appears once in the first string.

            Patterncount ( "applesauceAppleOrangeKiwi" ; "apple" )

            would return the value 2 and shows where care must be taken when using this function. If $List is a return separated list of values as is often the case thanks to checkbox formatted fields, ExecuteSQL queries, the List() function, "List of" summary fields...,

            Then the filtervalues function is a better option to use in place of patterncount in most cases.

            Both functions can be researched in FileMaker Help in order to learn more.