Hi all
Hope I can explain this.
Has anyone encountered an issue with outputing a returned string from a CFC
method?
I have a CFC that has a function that returns a string. The function use to
just be on a .cfm page that I <cfincluded>.
We have just recently upgraded to CFMX 7, so I wanted to get my functions
into CFCs.
using <CFOBJECT name="Myobject" Component="Components.myfunctions">
If I do this:
<CFSET newstring = Myobject.myfunction(oldstring)>
<CFOUTPUT>
#newstring#
</CFOUTPUT>
All is good
But if I do
<CFOUTPUT>
#Myobject.myfunction(oldstring)#
</CFOUTPUT>
I get extra non printable chars in front of the output.
After expermenting for awhile, I can see that the extra chars are being
placed in front of the returned string at the time of output.
Not by the function itself.
If I do:
<CFSET newstring = Myobject.myfunction(oldstring) &
Myobject.myfunction(oldstring) & Myobject.myfunction(oldstring)>
I get no extra chars.
The extra chars are added at the function dump to output
#Myobject.myfunction(oldstring)#.
Were this is an issue is in queries:
SET field1 = #Myobject.myfunction(oldstring1)#,
feidl2 = #Myobject.myfunction(oldstring2)#,
.....
I would have to do a bunch of cfsets before the query. Do able but annoying
to have the extra lines of code or
place the output into a rereplace expression.
Thanks for any help
Rodney
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:240262
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