ApplyToList ( ListA ; function, separator )
Apply FUNCTION to each item in list
Average rating: 4.2 (40 votes) Log in to vote
Bruce Robertson - Show more from this author |
Evaluate(
applyToList( list( invoiceItems::amount); "[n]"; "+" )
)
237.50
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
Given a list, apply a function to each item in the list and return the results separated by separator. Rather than walking a range from N1 to N2, this merely walks a list of supplied values. This is a recursive function. The range functions are great but sometimes you need to work with a list.
Use [n] notation to identify item in list.
applyToList( $$array ; "Case( Left( [n] ; 1)=1; [n])"; ", " )
=>
1 Adak, 10 Anchor Point, 11 Anchorage, 12 Anchorage, 13 Anchorage, 14 Anchorage, 15 Anchorage, 16 Anchorage, 17 Anchorage, 18 Anchorage, 19 Anchorage
Comments
Dan Shockley Apr 11, 2013 |
||
I noticed this function and the one by Debi Fuchs (found at http://www.briandunning.com/cf/899 ) have the exact same name, but the first two parameters are in reverse order compared to each other. That could lead to some serious confusion. Also, the function by Debi Fuchs handles potential errors much more thoroughly. Just a heads-up to anyone looking at these functions. |
||
Bruce Robertson Apr 11, 2013 |
||
Thanks. Looks like she went further with a more robust implementation of the idea. | ||
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.