Thanks everybody.

Amy you got my brain going. The problem as far as I know with using <cfif>
is that it can't be done inside the cfmail tag (i.e. <cfmail to="<cfif
expression>result</cfif> from="[EMAIL PROTECTED]">) So that's why I went with
the iif statement. What the problem was, as you noted were the pounds around
myCClist in the DE(). So I doubled up the pounds so that they wouldn't be
evaled as part of the iif statement. the resulting and working code was (for
anyone who's interested):

<cfmail
to="[EMAIL PROTECTED]"
#iif(IsDefined("myCClist") AND myCClist IS NOT "",
DE("cc=""##myCClist##"""), DE("empty"))#
from="[EMAIL PROTECTED]">

The email message.

</cfmail>

Thanks again everybody - nothing like a good old peer-powered kick-start of
one's brain :-)

Karl

> From: "Lauritzen, Amy [Ontario]" <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> Date: Thu, 23 May 2002 11:58:27 -0400
> To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
> Subject: RE: [CFTALKTor] iif error
> 
> Karl,
> 
> The problem is the pound signs in the second part (DE("cc=""#myCClist#""")).
> According to the Help on iif, pound signs cause the value to be filled in
> right away. DE does not delay this. So in your case, when the variable
> doesn't exist, it's trying to fill it in, and it never executes the test for
> existence. Unfortunately, I don't know a way to make this work using just
> iif (without cfif). You could use one of the following:
> 
> <CFIF IsDefined("myCClist") AND myCClist IS NOT "">
> cc="#myCClist#"
> </CFIF>
> 
> or
> 
> <CFIF IsDefined("myCClist")>
> #iif(myCClist IS NOT "",DE("cc=""#myCClist#"""),DE(""))#
> </CFIF>
> 
> The top one works because CF is smart enough to not check the second
> condition if the first is not met (there is no point, since it's an AND).
> 
> ~ Amy ~
> 
> 
> -----Original Message-----
> From: A. Karl Zarudny [mailto:[EMAIL PROTECTED]]
> Sent: May 23, 2002 11:32 AM
> To: [EMAIL PROTECTED]
> Subject: [CFTALKTor] iif error
> 
> 
> Hi everybody.
> 
> Any insight as to why
> 
> #iif(IsDefined("myCClist") AND myCClist IS NOT "", DE("cc=""#myCClist#"""),
> DE(""))#
> 
> would be returning the following error?
> 
> 
> 
> An error occurred while evaluating the expression:
> 
> 
> #iif(IsDefined("myCClist") AND myCClist IS NOT "", DE("cc=""#myCClist#"""),
> DE(""))#
> 
> 
> Error near line 280, column 3.
> ------------------------------------------------------------------------
> 
> Error resolving parameter MYCCLIST
> 
> 
> ColdFusion was unable to determine the value of the parameter. This problem
> is very likely due to the fact that either:
> 
> 1.    You have misspelled the parameter name, or
> 2.    You have not specified a QUERY attribute for a CFOUTPUT, CFMAIL, or
> CFTABLE tag.
> 
> 
> The error occurred while processing an element with a general identifier of
> (#iif(IsDefined("myCClist") AND myCClist IS NOT "", DE("cc=""#myCClist#"""),
> DE(""))#), occupying document position...
> 
> Is there a better way for me to do the same thing? This piece of code as I'm
> sure you can guess, is going within a cfmail tag. myCClist is cfset and does
> not result from a query. But regardless my thinking is that iif'ing with
> "IsDefined" is checking for myCClist's existence and it having values.... OR
> am I once again falling victim to sleep deprivation?
> 
> Thanks,
> Karl
> 
> -
> You are subscribed to the CFUGToronto CFTALK ListSRV.
> This message has been posted by: "A. Karl Zarudny"
> <[EMAIL PROTECTED]>
> To Unsubscribe, Please Visit and Login to http://www.CFUGToronto.org/
> Manager: Kevin Towes ([EMAIL PROTECTED]) http://www.CFUGToronto.org/
> This System has been donated by Infopreneur, Inc.
> (http://www.infopreneur.net)
> -
> You are subscribed to the CFUGToronto CFTALK ListSRV.
> This message has been posted by: "Lauritzen, Amy [Ontario]"
> <[EMAIL PROTECTED]>
> To Unsubscribe, Please Visit and Login to http://www.CFUGToronto.org/
> Manager: Kevin Towes ([EMAIL PROTECTED]) http://www.CFUGToronto.org/
> This System has been donated by Infopreneur, Inc.
> (http://www.infopreneur.net)

-
You are subscribed to the CFUGToronto CFTALK ListSRV.
This message has been posted by: "A. Karl Zarudny" <[EMAIL PROTECTED]>
To Unsubscribe, Please Visit and Login to http://www.CFUGToronto.org/
Manager: Kevin Towes ([EMAIL PROTECTED]) http://www.CFUGToronto.org/
This System has been donated by Infopreneur, Inc.
(http://www.infopreneur.net)

Reply via email to