FindInListƒ ( _list ; _value )
Get the value number of a value in a list
Average rating: 3.9 (40 votes) Log in to vote
Michael Rhodes Allied Data http://allieddataservice.com |
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
Determines the number of the array value that matches the value parameter.
Comments
bbb, melbourne australia Mar 13, 2009 |
||
Quotes around return character are not required. Need a return at the end of the array. Let ( [ array = ¶ & array & ¶ ] ; valuecount ( Left ( array ; Position ( array; ¶ & value & ¶; 1; 1 ) ) ) ) |
||
Michael Rhodes, Rancho Cucamonga, CA Mar 18, 2009 |
||
bbb, Thank you. Did not know quotes were not required around return character, although that does not affect functionality. Custom function works; corrected sample data. |
||
Michael Rhodes, Rancho Cucamonga, CA Mar 18, 2009 |
||
An array is assumed to be a value list. A return character added to the end is not necessary unless to account for an error if the array is malformed. Passing a value as the second parameter instead of text circumvents this error handling, however. | ||
Ben, realseeds Jan 23, 2017 |
||
Great custom function. I tried the following scenario: Let ( [ array = "30300¶303¶408" ; value = "303" ]; cfFindInList ( array ; value ) ) Result:2 Another scenario: Let ( [ array = "30300¶303¶408" ; value = "30" ]; cfFindInList ( array ; value ) ) Result:0 Correct result, ´cause the ( exact ) value 30 is NOT part of the array. The custom functions returns a value greater than 0 only if the exact value is in the array. This is exactly what this custom function does. Awesome. Thanks to the developer. |
||
Ben, realseeds Jan 23, 2017 |
||
In my program I add the prefix "cf" to all custom functions. | ||
Michael Rhodes, Colorado Springs, USA Mar 17, 2017 |
||
Thanks, Ben. I have been using Æ’ to denote custom functions for the last couple years. | ||
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.