Mike do a view source in the browser, you probably do have CRs and LFs 
but the browser looses them on display of course

Kym


On 30/03/2010 8:51 PM, Mike Kear wrote:
>
> I'm building a CFC which will write a CFC.  It will do some
> processing, then output to my browser, the code in text form, for me
> to copy and paste into my editor to be modified.  The idea is for the
> CFC i'm building to do a lot of the grunt work I do,  then i spend my
> time doing the tweaks on the code.
>
> It's a bit like ORM but I build quite a few CFCs for fairly common
> purposes that don't always involve  a database.
>
> Here's my question:   how can I write a CFC method,  which will output
> formatted text?   I know there's<pre>   and<cfsavecontent>   but they
> aren't giving me the output with linefeeds etc.     What have I
> forgotten?    I know I did this once, a long time ago but I'm dashed
> if I can remember how i got the line feeds and formatting.
>
> For example here's the method that writes the header of the file, but
> instead of producing a nicely formatted text block to the browser, it
> puts it all in one line. :
>
>    <cffunction name="Buildheader" access="public" returntype="string"
> output="false" hint="Builds the file header text.">
>       <cfargument name="Filename" type="string" required="yes" />
>               <cfset var headertext="" />
>
>      <cfsavecontent variable="headertext"><cfoutput>
> &lt;cfsilent&gt;
> &lt;!----
> ==========================================================================================================
> Filename:    #Filename#.cfm
> Description:
> Date:          #dateformat(now(), "d/mmm/yyyy")#
> Author:       Michael Kear
>
> Revision history:
>
> ==========================================================================================================
> ---&gt;
> </cfoutput></cfsavecontent>
> <cfreturn headertext />
>       </cffunction>
>
>


-- 

Yours,

Kym Kovan
mbcomms.net.au


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332427
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to