> When a function is called and the result outputted
> directly, an extra space is prepended!

It looks like the space isn't being prepended to the return value, but
ColdFusion is outputting whitespace from within the CFFUNCTION tag when it
is called.  Even more interesting, it's only outputting whitespace AFTER the
last CFARGUMENT tag.

So if you put a CFSILENT within the CFFUNCTION immediately after the last
CFARGUMENT tag, it will suppress the whitespace.  Close the CFSILENT right
after the CFRETURN is called.  This appears to be a viable workaround.  Plug
this into your previous example...

<cffunction name="spaceTest">
        <cfargument name="s" type="string"><cfsilent>
        <cfreturn "<-NO MORE SPACE HERE">
        </cfsilent>
</cffunction>

Tested in CF 7.


-Justin Scott



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:222340
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to