Brian Dunning's FileMaker Custom Functions

PositionX ( text ; searchString ; start ; occurrence ; matchcase )

extended Position() function that can also work Case Sensitive

  Average rating: 3.9 (37 votes) Log in to vote

Theo Ros   Theo Ros

Share on Facebook Share on Twitter

  Sample input:
PositionX ( "abcABC" ; "A" ; 1 ; 1 ; True )
  Sample output:

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

The Position() function in FM7 is always Case Insensitive...
The Substitute fortunately is not.
If you want a case sensitive Position function, use this one,
with final parameter 'matchcase' set to True (1).

In: text - the textfield or literal string you want examined
searchString - the string to look for
start - the position where to start searching
occurrence - any numeric expression or field containing
a number, representing which instance of
the text string you want to find. A negative
occurrence value causes the scan to go in
the opposite direction from start. A zero
value for occurrence is invalid and returns a result of zero.
matchcase - if set to True (any value not equal to zero)
the function does a Case Sensitive search.
if False (0) the function behaves Case Insensitive

Syntax: PositionX ( text ; searchString ; start ; occurrence ; matchcase )

Return type: Number

(this is an adaptation of the PositionCS() function by Christian Jäger)



Log in to post comments.


Note: these functions are not guaranteed or supported by Please contact the individual developer with any questions or problems.

Under construction. Email me your wish list for improvements.