Brian Dunning's FileMaker Custom Functions

OffsetInList ( theList ; value )

Returns the item position of value (first instance only) within theList. Returns 0 otherwise.

  Average rating: 4.2 (41 votes) Log in to vote

Don Aehl   Don Aehl
none
http://nop

Share on Facebook Share on Twitter

  Sample input:
OffsetInList ( "abc¶def¶ab¶de¶ab¶d¶a" , "d" )
  Sample output:
6

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

Returns the item position of value (first instance only) within theList. Returns 0 otherwise.

 

Comments

WilliamCB   WilliamCB, London
Mar 26, 2009
This function fails by returning the value 0 in the scenario where the value is 75AH and theList is
21AH
91AH
75AH
36AH
63AH
130AH
121AH
107AH
42AH
120AH
19AH
101AH
144AH
14AH
116AH
40AH
33AH
133AH
88AH
60AH
45AH
86AH
90AH
67AH
62AH
22AH
138AH
139AH
135AH
100AH
208AH
34AH
132AH
13AH
124AH
128AH
32AH
1AH
117AH
127AH
39AH
59AH
31AH
92AH
118AH
5AH
72AH
65AH
136AH
58AH
110AH
 
WilliamCB   WilliamCB, London
Mar 26, 2009
I recommend the WordPosition custom function instead.
 
Don Aehl   Don Aehl, Waukesha, WI
Apr 17, 2009
WilliamCB,

I pasted the data you listed above, but my OffsetInList function returns 3, not 0 as you indicate.
 

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: