Brian Dunning's FileMaker Custom Functions

AddOrRemoveValue ( listOfValues ; value )

Speedily (and with no recursion/cleanup) remove all instances of a value from a list, or add it, if it's not there.

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

Debi Fuchs   Debi Fuchs - Show more from this author
Aptworks Consulting
http://www.aptworks.com

Share on Facebook Share on Twitter

  Sample input:
AddOrRemoveValue("¶9¶2¶4¶8¶8¶¶7¶¶8¶9¶¶"; "8") -> "¶9¶2¶4¶¶7¶¶9¶¶"
  Sample output:
"¶9¶2¶4¶¶7¶¶9¶¶"

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

Speedily (and with no recursion or cleanup of empty values) remove all instances of a value from a list, if the value exists in the list already, or add it, if not. (For list cleanup try custom function CullNulls).

 

Comments

Debi Fuchs   Debi Fuchs, Aptworks Consulting
Aug 28, 2018
fixed a bug which caused the function not to work on single-value lists
 

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: