I have a simple list: 1, 3, 6, 7, 11, 13, 16, 21
I want to count the list where the numbers are greater than 8. So my end result for this list should be "4" (11, 13, 16, 21).
I've read through all the list functions and nothing seems to fit. How do I evaluate the items in a list to see fi they greater than 8 then count only those items?
Initialise a new list as an empty string.
Loop over the first list with CFLOOP:
Check each element for your condition.
If it meets the condition, append it to the new list.
After the loop, the new list will have the values you want.
There is no more expedient way of doing it than that, really.
Well: if yer on CF10, there's listFilter() which might work for you:
It's probably not as expedient as just looping over the list though.
Europe, Middle East and Africa