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.

  Be the first to rate this function Log in to vote

Debi Fuchs   Debi Fuchs
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.

Under construction. Email me your wish list for improvements.