Brian Dunning's FileMaker Custom Functions

ValueIndexByPosition ( valueList, searchValue, matchCase, occurrence, positionLCR )

Retrieve the index of the value in valueList containing the matching searchValue.

  Be the first to rate this function Log in to vote

Lewis Lorenz   Lewis Lorenz - Show more from this author
Lorenz Companies
http://www.LorenzCom.com

Share on Facebook Share on Twitter

  Sample input:
ValueIndexByPosition ( "Alpha¶Bravo¶Charlie¶Echo", "charl", False, 1, "L" )
  Sample output:
3

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

ValueIndexByPosition ( valueList, searchValue, matchCase, occurrence, positionLCR )

Retrieve the index of the value in valueList containing the matching searchValue. Returns 0 if not found.
Toggle case-sensitive searching by passing a boolean through matchCase.
Search for specific searchValue occurrence. A negative occurrence number causes backward search from the end of the valueList.
Specify whether to match the searchValue from the Left, Center ( middle ) , or Right within the value.

NOTICE: Requires FileMaker Pro 18+.

Examples:
ValueIndexByPosition ( "Alpha¶Bravo¶Charlie¶Echo", "charl", False, 1, "L" ) = 3
ValueIndexByPosition ( "Alpha¶Bravo¶Charlie¶Echo", "charlie", True, 1, "L" ) = 0
ValueIndexByPosition ( "Daniel¶Danny¶Bill¶daniel¶Frank¶daniel¶Ed", "aniel", True, -2, "R" ) = 4
ValueIndexByPosition ( "Daniel¶Danny¶Bill¶daniel¶Frank¶daniel¶Ed", "an", False, -2, "C" ) = 5

 

Comments

Log in to post comments.

 

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

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 20 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: