<cfreturn multiply( num, num ) >

CFC methods are local to the CFC. There is no chance of a name collision
unless you specifically scope the function to an external scope (i.e.
application). If you try to call a function that doesn't exist in the CFC
(or one of its superclasses) you will get an error.

On 6/11/07, Joe Lakey <[EMAIL PROTECTED]> wrote:

If a function within a CFC calls another function within the same CFC,
is it necessary to qualify the function call with "this" or "variables"?
What if there is a known possibility of a name collision with a function
outside of the CFC?

For example:

<cfcomponent displayname="math">

   <cffunction name="multiply" ... >
      <cfargument name="num_1" type="numeric" required="yes">
      <cfargument name="num_2" type="numeric" required="yes">
      <cfreturn arguments.num_1 * arguments.num_2 >
   </cffunction>

   <cffunction name="square" ... >
      <cfargument name="num" type="numeric" required="yes">

      <!--- WHICH (IF ANY) OF THE FOLLOWING THREE LINES IS CORRECT? --->
      <cfreturn multiply( num, num ) >
      <cfreturn this.multiply( num, num ) >
      <cfreturn variables.multiply( num, num ) >
   </cffunction>

</cfcomponent>

Thanks,

Joe


You are subscribed to cfcdev. To unsubscribe, please follow the
instructions at http://www.cfczone.org/listserv.cfm

CFCDev is supported by:
Katapult Media, Inc.
We are cool code geeks looking for fun projects to rock!
www.katapultmedia.com

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




You are subscribed to cfcdev. To unsubscribe, please follow the instructions at 
http://www.cfczone.org/listserv.cfm

CFCDev is supported by:
Katapult Media, Inc.
We are cool code geeks looking for fun projects to rock!
www.katapultmedia.com

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

Reply via email to