Brian Dunning's FileMaker Custom Functions

FilterList ( beginsWith ; oldList ; newList ; iteration )

This recursive function will take a list and return a new list without list values that start with the supplied beginsWith string.

  Average rating: 5.0 (24 votes) Log in to vote

Chris McCue   Chris McCue
Chris McCue
http://www.imccue.com

Share on Facebook Share on Twitter

  Sample input:
FilterList ( "app" ; "apple¶application¶astro¶baseball" ; "" ; "" )
  Sample output:
astro
baseball

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

This recursive function will take a list and return a new list without list values that start with the supplied beginsWith string.

 

Comments

Lorne Walton   Lorne Walton, Maple Ridge, Canada
Mar 12, 2012
Either the cf description is incorrect, or the example give the wrong result.
The result should be:

astro
baseball
 
Chris McCue   Chris McCue, Dallas, TX
Mar 12, 2012
Doh! Nice catch, thanks.
 
Bart Bartholomay   Bart Bartholomay, Vero Beach
Mar 13, 2012
I also think the description is misleading. You're filtering a list, ie you're return values that remain after applying the filter. Here you're taking them out. Why not call it:

ContractList ( theList ; theValue ; theNewList ; theIteration )

Notice that I've reversed the first two and renamed the params for clarity.
 
Davide Puppo   Davide Puppo, Italy
Jun 16, 2018
A great variation is having the list with only the value that "begins with"

change
beginsWith = Left ( $val ; $length )
with
beginsWith ≠ Left ( $val ; $length )
 

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.

Under construction. Email me your wish list for improvements.