This email is to be read subject to the disclaimer below.

Hi Mark,

This is a whitespace issue in coldfusion - but luckily CFC's provide a nice
way to deal with it - add output="false" to your cffunction declaration.

eg:
<cffunction name="getMyVar" access="public" returntype="string"
output="false">
      <cfreturn instance.myVar>
</cffunction>

In almost all situations it is worth setting output to false - the only
reason that you wouldn't is if you are debugging your cfc's and want to see
output from a CFC or if you have a CFC that outputs html directly.

Regards,
Mark Lynch
Development Manager - Business Innovation Online
Ernst & Young - Australia
http://www.eyware.com/
http://www.eyonline.com/
Direct: +612 9248 4038
Fax: +612 9248 4073
Mobile: +61 421 050 695


                                                                                       
                                                            
                       "Mark Mandel"                                                   
                                                            
                       <[EMAIL PROTECTED]>             To:      "CFAussie Mailing 
List" <[EMAIL PROTECTED]>                         
                       Sent by:                            cc:                         
                                                            
                       [EMAIL PROTECTED]         Subject: [cfaussie] Re: Weird Line 
Breaks on Accessing CFC variables  [Virus checkedAU] 
                       aemon.com.au                                                    
                                                            
                                                                                       
                                                            
                       03/02/2004 11:36 AM                                             
                                                            
                       Please respond to "CFAussie                                     
                                                            
                       Mailing List"                                                   
                                                            
                                                                                       
                                                            
                                                                                       
                                                            



Just to further this one on -

I did a small test harness for this - and yeah, i'm not going nuts:

Watch what happens when:

--- myObj.cfc ---
<cfcomponent>

             <cfscript>
                         instance = Structnew();
                         instance.myVar = "";
             </cfscript>


             <cffunction name="getMyVar" access="public"
returntype="string">
                         <cfreturn instance.myVar>
             </cffunction>
</cfcomponent>
-----------------

--- index.cfm ---
<html>
<head>
<title></title>
</head>
<body>

             <cfscript>
                         o = createObject("component", "myObj");

             </cfscript>

             <cfoutput>
             <pre>
             [#o.getMyVar()#]
             </cfoutput>
             </pre>

</body>
</html>
-----------------

You end up with

[
     ]

Is this some weird bug I'm not aware of?

TIA

Mark

---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to
[EMAIL PROTECTED]

MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004





--------------------
NOTICE - This communication contains information which is confidential and
the copyright of Ernst & Young or a third party.

If you are not the intended recipient of this communication please delete
and destroy all copies and telephone Ernst & Young on 1800 655 717
immediately. If you are the intended recipient of this communication you
should not copy, disclose  or distribute this communication without the
authority of Ernst & Young.

Any views expressed in this Communication are those of the individual
sender, except where the sender specifically states them to be the views of
Ernst & Young.

Except as required at law, Ernst & Young does not represent, warrant and/or
guarantee that the integrity of this communication has been maintained nor
that the communication is free of errors, virus, interception or
interference.

Liability limited by the Accountants Scheme, approved under the
Professional Standards Act 1994 (NSW)
--------------------




---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

Reply via email to