I believe the following will work ---

<cffunction name="functionname" output="true">
<cfargument name="whatever" >
<cfset var whatever = arguments.whatever />

Logic stuff in here.

<cfsavecontent variable="outputstuff"><html><head></head> etc . your ourput
stuff goes here.</cfsavecontent>

<cfreturn outputstuff />
</cffunction>


Then in your calling page you have :

<cfset outputgenerator = createobject("component", "outputgenerator").init()
/>
<cfset myoutput = outputgenerator.functionname( whatever ) />

<cfoutput>#myoutput#</cfoutput>


This way you're not outputting code directly from the CFC,  only generating
a string of output tags, which you're going to use in the calling page. it's
a couple of years since i've done it, but if my memory is serving me right,
that's how i solved the problem for a complex XML output cfc application,
where white space was really causing problems.  You only have to limit the
white space in your CFC between the CFSAVECONTENT tags.


Cheers
Mike Kear
Windsor, NSW, Australia
Adobe Certified Advanced ColdFusion Developer
AFP Webworks
http://afpwebworks.com
ColdFusion 9 Enterprise, PHP, ASP, ASP.NET hosting from AUD$15/month


On Fri, Aug 6, 2010 at 1:10 AM, Robert Harrison
<[email protected]>wrote:

>
> Apparently you cannot use CFSILENT or CFSETTING inside a function at all.
> Using either of these tags in the function give me the following error:
>
>
> The start tag must have a matching end tag. An explicit end tag can be
> provided by adding </cffunction>. If the body of the tag is empty, you can
> use the shortcut <cffunction .../>
>
>
> Robert B. Harrison
> Director of Interactive Services
> Austin & Williams
> 125 Kennedy Drive, Suite 100
> Hauppauge NY 11788
> P : 631.231.6600 Ext. 119
> F : 631.434.7022
> http://www.austin-williams.com
>
> Great advertising can't be either/or.  It must be &.
>
> Plug in to our blog: A&W Unplugged
> http://www.austin-williams.com/unplugged
>
>
>
> __________ Information from ESET Smart Security, version of virus signature
> database 5343 (20100805) __________
>
> The message was checked by ESET Smart Security.
>
> http://www.eset.com
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336025
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to