What you have to do is this:

(assuming you're using variables temp1 and temp2)

IIF(condition, DE("#evaluate('temp1')#"), DE("#evaluate('temp2')#"))

By using evaluate, it doesn't try to pass the undefined variable in as a
parameter to the function, but when it hits the DE(), it does an evaluate()
and displays the contents of the variable anyway.

-----Original Message-----
From: Aidan Whitehall [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 30, 2001 10:12 AM
To: CF-Talk
Subject: RE: IIF and DE


> This problem is kinda hard to explain, but does anyone have
> any idea on how
> to fix this??? (without having to use CFIF/CFELSE - the whole
> point is that
> I want to use IIF and DE)

This isn't what you want to hear, but, FWIW I've had exactly the same thing
and ended up using CFIF. Annoying, but I couldn't figure out how to code the
Iif so that it didn't throw the error when it hit the undefined variable,
even if you put the undefined variable in the last part (what's the right
term?) of the Iif function.



Aidan
--
Aidan Whitehall <[EMAIL PROTECTED]>
Macromedia ColdFusion Developer
Fairbanks Environmental +44 (0)1695 51775
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to