I actually find the current behavior intuitive. Are there equivalents of PatternCount( ) and Position( ) in other languages/developing environments where overlapping repeats are taken into consideration?
Test with non-repeating characters to see the logic.
Enter "xoxoxoxoxoxoxoxo" and search for "xo"; it finds the "xo" set 8 times.
Change the "o" to an "x", enter "xxxxxxxxxxxxxxxx", and search for "xx". Again, 8 sets of "xx" are counted.
I believe the logic is that once a set has been counted [the first xx], it does not *double-back* to begin at position 2, but looks for the next instance of "xx", which is found starting at position 3.
In your example, the first "xx" is counted and counting begins anew at position 3. There is not another instance of "xx" from that point forward.
From the FileMaker Help:
PatternCount(“Mississippi”;“issi”) returns 1 (the function isn’t inclusive). (bold format by me)
These are the little things that are often overlooked in the FileMaker Help and should be written down more clearly. All the information is usually there, but one has to read very carefully to not miss a detail. Something that should be reported in the current survey about FileMaker documentation.
oooo, a FEATURE REQUEST (additional parameter - boolean):
patternCount ( text; searchStr; start; occurrence; case )
if 'case' is 0 or NULL (default) then case doesn't matter. if 'case' is 1, the search by case.
But I'm not sure I'd want inclusive.
Oops, Beverly, you mixed up the parameters of PatternCount and Position!
Coffee! Need coffee. LOL
-- sent from my iPhone4 --
wheW! How about these:
Position ( text; searchStr; start; occurrence; case )
PatternCount ( text; searchStr; case )
Must have been strong coffee ...