you could just toss your outgoing variable into a Trim() function before
using it, that will trim the left and right spaces.

J.

John Wilker
Web Applications Consultant
Macromedia Certified ColdFusion Developer

www.red-omega.com <http://www.red-omega.com>

"Losing - If at first you don't succeed, failure may be your style."
~despair.com


-----Original Message-----
From: Jamie Jackson [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 17, 2001 1:01 PM
To: CF-Talk
Subject: EnableCFoutputOnly not cutting the mustard in Custom Tag


I've got a custom tag which returns a small string, but I can't get
rid of the extra spaces around the string when it's called. This has
screwed me up several times, and I haven't found a solution yet.
EnableCFoutputOnly gets rid of most of the garbage whitespace, but it
leaves a space to the left and right of the desired output string.

####### Custom Tag ########
<cfsetting enableCFoutputOnly="yes">
<cfscript>
FinalValue = result_of_a_bunch_of_processing;
writeOutput(FinalValue);
</cfscript>
<cfsetting enableCFoutputOnly="no"

####### Calling Script ########
FinalValue = "<cf_MyCustomTag>"

###### Results in Browser ######
FinalValue = " result_of_a_bunch_of_processing "

But, I would like to see:
FinalValue = "result_of_a_bunch_of_processing"

See those spaces that show up? What's causing them? How do I get rid
of them?

Obviously there are workarounds, such as:
*Send the string back to the calling script with caller.FinalValue

However, I would like to know if this can work without going the
caller-scope route.

Thanks,
Jamie
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to