The IIf() function is used to perform inline conditional processing, taking an expression to evaluate as the condition, and the expressions to be evaluated upon that evaluation returning true or false. But what if those latter expressions were literal strings to be displayed as is (and not evaluated as expressions)? To do this you must delay evaluation of those inner expressions using the DE() function. So, IIf(CurrentRow MOD 2 IS 0, DE(color1), DE(color2)) will output the contents of variables color1 and color2 instead of evaluating them. (Applies to: ColdFusion 3 (or later))

Leave a Reply