AFAIK the IIF tag evaluates both the true and the false sections as the
function is processed... The best thing to do would be cfparam the
variable and check to see if it contains data.....
<CFPARAM NAME="FORM.classCodeID" DEFAULT="">
#IIF(Len("FORM.classCodeID"), DE("#FORM.classCodeID#"), DE("ALL"))#
HTH
Mike
-----Original Message-----
From: Jason Green [mailto:[EMAIL PROTECTED]]
Sent: 31 October 2001 21:20
To: CF-Talk
Subject: IIF() HELP!!!
why is it when you use IIF() and you are checking to see if a variable
exists, the process will error out? here is an example:
#IIF(IsDefined("FORM.classCodeID"), DE(FORM.classCodeID), DE("ALL"))#
if FORM.classCodeID exists, the code works fine. but if
FORM.classCodeID
doesn't exist, it errors saying it can't find FORM.classCodeID.
shouldn't
it run the second DE() statement? am i just not understanding the whole
IIF() tag? has anyone else run into this and is there anyway of making
it
work without using <CFIF> tags?
jason
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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