A boolean condition or value is passed into the first argument. If the condition is true
the second argument is evaluated and returned, if false
the third argument is evaluated and returned.
iIf(condition, expression1, expression2)
→ returns string
( (condition) ? valueIfTrue : valueIfFalse )
true
.
false
.
iIf( server.os.name IS "Bacon", de("Running Bacon OS"), de("Not Running Bacon OS") )
Expected Result: Not Running Bacon OS
Instead of using iif, you should use the ternary operator CF 9+
( (server.os.name IS "Bacon") ? "Running Bacon OS" : "Not Running Bacon OS")
Expected Result: Not Running Bacon OS
Signup for cfbreak
to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.