I wanna say that "IIF()" is a slow function and Macromedia has hinted at eventually killing the slow functions.. I believe "may not work in future releases" is close to the exact terminology..
Its stupid if you ask me.. but in that case... Here's what I'd do
Put the following code somewhere around the top of the page.. before your cfoutput in which you want to use the alt coloring..
Code:
Set your colors:
<cfset ArrColors=ListToArray("##FFFFFF","##EFEFEF")>
Code:
Read your colors:
bgcolor="###ArrColors[ListFind(form.afield,rInfoz.afield_id)[b]+1[/b]]#"
Ok the way this works is it turns ArrColors into an array.. Array's start at #1 so
1: #FFFFFF
2: #EFEFEF
And then it uses the listfind function and the way listfind works, is if it finds it, it returns the position of the first time it found it.. since this variable is not a list, its only one element long.. So it would return "1".. If it does not find it, it returns 0..
That's what the bolded "+1" is for.. it adds 1 to the position, so when it can't find it, and it returns 0, it adds 1.. when it can find it and it returns 1, it adds and because 2.. Calling array position 2.
ALFII.com
---------------------
If this post answered or helped to answer your question, please reply with such so that forum members with a similar question will know to use this advice.