1 of 1 people found this helpful
Substitute ( _rem ; "¶¶" ; "¶" )
That does the trick, thanks!
I just tried it with the first value of the list, and that doesn't do the whole trick. It seems like there needs to be trapping for first and list item cases.
It's too bad that FM doesn't have some kind of native array functionality.
They need some logical operators for lists. We have an existing function, filterValues, which will return values in list A that match values of list B. But there should be a similar function that returns values in List A that are NOT in list B.
I ( and others) have written a custom function that does this but it should be a native FileMaker function.
The function is available here:
Hmm I forgot about the first and last line dilemmas. This appears to work in the Data Viewer.
Let ( [
_list = List ( "¶" & "CA4B24A9-F232-4296-9AE5-AE9EC6FCEAF4"; "AD6AAF4D-AD1F-40F6-BE0A-AE6922382FA0"; "6A051084-3D44-48FA-BFC2-78390A7BAE58"; "3BB29EDC-2B61-41EC-A785-CD8264585B19" & "¶" );
_rem = Substitute ( _list ; "¶" & "CA4B24A9-F232-4296-9AE5-AE9EC6FCEAF4" & "¶" ; "¶" )
Right ( _rem ; Length ( _rem ) - 1 )
Hopefully they'll add something cool like actual arrays and their manipulation in 13.
Here's my version of a solution.
Let ( [
ListA= List ( "CA..."; "AD..."; "6A..."; "3B..." )
; ListB= List ( "CA..." ; "6A..." )
; XORset= XORvalues ( ListA ; ListB )
; uniqueToA= FilterValues ( XORSet ; ListA )
; uniqueToB= FilterValues ( XORSet ; ListB )
SuperTrim ( uniqueToA )
Which uses two of my favorite custom functions from two of the best developers in our community:
XORValues http://www.briandunning.com/cf/39 which gives you the set of values that are unique to two lists. When you feed in duplicate values (in either ListA or List B), it removes them from the result. In fact, Ray Cologon points out the XORValues (ListA ; "" ) returns a de-duplicated ListA.
SuperTrim http://www.briandunning.com/cf/904 which removes leading and trailing white space from text without recursion, and is lightning fast. Debi Fuchs is just brilliant.
-- Drew Tenenholz