the variable must exist or you cannot evaluate it.
In my example I specified saving the content to a file and cfincluding it,
which is not what you have done below.

This works fine for what you want below.

<cfset content = "this is some dynamic content">
<cfset foo = "This is static content. #content#">

<cfoutput>
#foo#
</cfoutput>
Here is an example of evaluating an external file.

<cfset content = "this is some dynamic content">
<cfsavecontent variable="contentfile">
<cfinclude template="content.cfm">
</cfsavecontent>
content from file:<br>
<br>

<cfoutput>
#evaluate(de(contentfile))#
</cfoutput>

--
Russ (snake) Michaels



-----Original Message-----
From: "Bruce, Rodney S C-E LCMC HQISEC/Signal Solutions"
<[EMAIL PROTECTED]>
To: CF-Talk <cf-talk@houseoffusion.com>
Date: Tue, 18 Apr 2006 13:30:08 -0700
Subject: RE: Evaluate vs ?

> Ok, guess I am missing something here:
> 
> 
> <cfset foo = "fee fi fo fum #variable# this is dynamic content">
> If #variable# is not set CF errors, If #variable# is set puts value
> into
> foo.
> 
> 
> <CFOUTPUT>
> #foo#    -------foo would output to be   "fee fi fo fum #variable# this
> is
> dynamic content"  is what was wanted??
> </CFOUTPUT> -----not necessarily outputted, but to still contains the
> #variable# unresolved?
> 
> 
> This will set that up:
> <cfset foo = "fee fi fo fum ##variable## this is dynamic content">
> 
> But even using evaluate, this errors with (Invalid CFML construct
> found):
> 
> <cfset variable = "fub">
> 
> <cfoutput>
> #evaluate(foo)#
> </cfoutput>
> 
> And just to test, this errors if #variable# is not set
> <cfset foo = Evaluate("fee fi fo fum #variable# this is dynamic
> content")>
> 
> Can you show were this would work and be used, with evaluate?
> Have me curious now.
> 
> 
> 
> 
> -----Original Message-----
> From: Aaron Rouse [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, April 18, 2006 12:24 PM
> To: CF-Talk
> Subject: Re: Evaluate vs ?
> 
> 
> This does the same thing as his:
> 
> <cfset foo = "fee fi fo fum #variable# this is dynamic content">
> 
> My guess is he was saying for the value of "variable" to not be put
> into foo
> until the time that it was outputed instead of when set.
> 
> 
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238063
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to