I am new to Coldfusion and trying to build a string something like
<cfif qRoute.a IS NOT "">
<cfset str= qRoute.a>
<cfif qRoute.b IS NOT "">
<cfset str= str& " / "& qRoute.b>
</cfif>
<cfif qRoute.c IS NOT "" >
<cfset str= str& " / "& qRoute.c>
</cfif>
</cfif>
But it seems to me to be very basic technique. Is there a better way to write the code.
This would perhaps be an approach. it's a complete stand-alone repro, but the bit you want to look at is the
listAppend()
stuff:On ColdFusion 9, this outputs:
Is that more what you're after?
The code for more recent versions of CFML would be much nicer, but you're kinda hamstrung by using an obsolete version of CF (which I'm sure is outwit your control, but it irks me to have to write such clumsy code)