Brian Dunning's FileMaker Custom Functions

RemoveValues ( ValueList ; ValuesToRemove )

Remove a list of values from another list ( doesn't use While() so pre Fm18 safe )

  Average rating: 5.0 (1 vote) Log in to vote

Nat Robinson   Nat Robinson - Show more from this author
Beezwax

Share on Facebook Share on Twitter

  Sample input:
RemoveValues ( "A¶B¶C¶D¶E¶F¶G" ; "F¶B" )
  Sample output:
"A¶C¶D¶E¶G"

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

Filters a list by using another list of values to remove. Not order-dependent, removes each value separately. Will protect any leading carriage returns or internal double carriages. This list of valuesToRemove is not order-dependent. Made it recursive so it would be Pre Fm 18 safe.

 

Comments

Jack Ferret   Jack Ferret, Bel Covo
Jun 15, 2020
This is exactly what I was looking for, but...
RemoveValues ( "A¶B¶C¶D¶E¶F¶G" ; "F¶B" ) ACTUALLY RETURNS: "A¶C¶D¶E¶G" (contrary to the currently-listed sample output), removing all instances of 'F' and 'B' from the list entirely. Like I said, exactly what I needed, so thank you.
 
Nat Robinson   Nat Robinson, Beezwax
Jun 16, 2020
Ha! I posted in hasted excitement. I've updated the sample output result in the description. Thanks for catching that and letting me know, Jack.
 

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: