Brian Dunning's FileMaker Custom Functions

PositionValues ( Text ; Value )

Return value number of Value in Text.

  Average rating: 4.6 (33 votes) Log in to vote

Koji Takeuchi   Koji Takeuchi - Show more from this author
TonicNote, Inc.
https://tonicnote.com

Share on Facebook Share on Twitter

  Sample input:
PositionValues ( "A¶B¶C" ; "B" )
  Sample output:
2

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

PositionValues ( Text ; Value )
2011.03.26, Koji Takeuchi


description:
Return value number of Value in Text.
ex.
Text = return seperated text
"A¶B¶C" or
List ( TO::Field ) or
ValueListItems ( Get ( FileName ) ; "ValueListName" )
Value = search text
"B" or
one line value to search in Text

PositionValues ( "A¶B¶C" ; "B" )
-> 2

 

Comments

comment   comment, VR
Mar 26, 2011
How about a simple one:

Index ( listOfValues ; searchValue ) =

ValueCount ( Left ( listOfValues ; Position ( ¶ & listOfValues & ¶ ; ¶ & searchValue & ¶ ; 1 ; 1 ) ) )


See also:
http://www.briandunning.com/cf/908
 
Koji Takeuchi   Koji Takeuchi, TonicNote, Inc.
Mar 26, 2011
Hey, that one is 10x cooler than mine...
Thanks for suggesting.
 

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: