> whats an easy way to append a string to a string?

> I'm trying to do this:

> // php
> $output  = "<table border='$border' bgcolor='$color'>";
> $output .= "  <tr>";
> $output .= "    <td>";
> etc...

> .  in CF.

> I don't want to use <cfscript> though.

<cfset output = "<table border='#border#' bgcolor='#bgcolor#'>">

or

<cfset output = "<table border='" & border & "' bgcolor='" & bgcolor & "'>">

or ( CF5 only )

<cfoutput><cfsavecontent variable="output">
        <table border="#border#" bgcolor="#bgcolor#"><tr><td>
</cfsavecontent></cfoutput>

All of these will give you roughly the same results... and when building
larger strings which include html formatting ( tables in particular ) I tend
to go with the latter, since it eliminates the need to escape double or
single quotes.

Isaac Dealey
Certified Advanced ColdFusion Developer

www.turnkey.to
954-776-0046
______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.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

Reply via email to