Hi Raymond,

Thank you very much for the response.
 
>First, why the use of cfsilent?
 This is a long story. In order to gain some speed by the upgading, we use this 
function to repalce a custom tag through a perl script. The cfsilent is left over from 
calling the custom tag. Because this is a multilinguge site, the function is used to 
display all the UI string depends the language code passed in, and it is called on 
every display page. Test results from the 3 developer's machine shows a big speed 
gain. 

> what do you get if you add isDefined("ct_out")

It returns false.

>I notice you set stringbalue to
application[somekey][somekey]etc. Are you sure that key exists?

Yes, because this is tha same code as on the developer's machine and and the same 
database. That is why when we put the function directly in the application.cfm it 
works fine. But if use <CFinclude> it got the problem.


Thanks.

Sima
-----Original Message-----
From: Raymond Camden [mailto:[EMAIL PROTECTED]
Sent: Monday, July 21, 2003 2:18 PM
To: CF-Talk
Subject: RE: problem with CFFunction return


First, why the use of cfsilent? Is it because you discover that calls to
cffunction-based UDFs generate white space? Simply add output=false to
your cffunction tag and that will go away. (This assumes your UDF isn't
mean to output directly, which it should not do 99% of the time.)

So, what do you get if you add isDefined("ct_out"), does it return
false? Also, I notice you set stringbalue to
application[somekey][somekey]etc. Are you sure that key exists?

========================================================================
===
Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc
(www.mindseye.com)
Member of Team Macromedia (http://www.macromedia.com/go/teammacromedia)

Email    : [EMAIL PROTECTED]
Blog     : www.camdenfamily.com/morpheus/blog
Yahoo IM : morpheus

"My ally is the Force, and a powerful ally it is." - Yoda 

> -----Original Message-----
> From: Lee, Sima - Workstream [mailto:[EMAIL PROTECTED] 
> Sent: Monday, July 21, 2003 12:08 PM
> To: CF-Talk
> Subject: problem with CFFunction return
> 
> 
> Hi All,
> 
> We are just in the process of upgrade CF4.5 to CFMX. We had a 
> very strange problem with <CFFunction>. 
> 
> We have a very simple function which returns a string:
> 
> <CFFUNCTION name="getString" returntype="string">
> <CFARGUMENT name="VarName" type="string" required="true"> 
> <CFARGUMENT name="Pcode"  type="string" required="true">
> <CFARGUMENT name="suff"   required="true">
> <CFARGUMENT name="LgCode"  default="#g_LG#" type="string" 
> required="false" > <CFSET var 
> stringvalue=application["lg#lgcode#"][pcode][varname]>
> <CFIF suff NEQ ""><CFSET Stringvalue= StringValue & 
> suff></CFIF> <CFRETURN Stringvalue> </cffunction> 
> 
> Then using <CFINClUDE> to include the file which contains 
> this function in the application.cfm
> 
> When we call it like this(in javascript within a pair of 
> <CFOUTPUT>): <CFSILENT><CFSET 
> ct_out=GetString("jsPleasecheck", "Labels", "")></CFSILENT>
>         alert("#jsStringFormat(Ct_out)#");
> 
> It works  fine with all the three developer's local 
> machines(CFMX). However when the code was sent to QA, MX 
> complains that the variable CT_OUT is not defined. 
> Checkout the view source found out that the return value is 
> not resolved, the source code look like this: alert(" 
> CFRETURN stringvalue>
> 
> But if we put the entire function on the application.cfm 
> instead of in an included file it works OK. 
> 
> Does anybody knows why?
> 
> 
> Thanks.
> 
> 
> Sima 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

Get the mailserver that powers this list at 
http://www.coolfusion.com

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to