If you return this from init() you can write code like this:

<cfset obj = createObject("component","mycfc").init(myargs)>

which is quite neat. 

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
> Of Nando
> Sent: Tuesday, 4 November 2003 3:03 p.m.
> To: [EMAIL PROTECTED]
> Subject: [CFCDev] cfreturn this ???
> 
> Hi,
> 
> I'm a little foggy on what returning "this" actually does for you in an
> init
> method.
> 
> What's the practical difference between
> 
>       <cffunction name="init" access="public" returntype="com.User"
> output="no">
>               ...
>       <cfreturn this />
>       </cffunction>
> 
> and
> 
>       <cffunction name="init" access="public" output="no">
>               ...
>       </cffunction>
> 
> Knowing this a little more clearly would help me to understand exactly
> what
> i'm doing here, and when it would be advantagous or correct to return the
> object.
> 
> :)
> 
> thanks,
> 
> Nando
> 
> 
> ----------------------------------------------------------
> You are subscribed to cfcdev. To unsubscribe, send an email
> to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev'
> in the message of the email.
> 
> CFCDev is run by CFCZone (www.cfczone.org) and supported
> by Mindtool, Corporation (www.mindtool.com).
> 
> An archive of the CFCDev list is available at www.mail-
> archive.com/[EMAIL PROTECTED]



----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev'
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]

Reply via email to