On Mar 19, 2004, at 4:55 PM, Stephen Milligan wrote:
If you are calling a private method in a CFC from a public method you can't
pass the arguments as name=value pairs:

Only if you specify "variables." when you call it (you can't call methods in "super" scope with named arguments either):


test.cfc
<cfcomponent>
        
        <cffunction name="publicone" access="public">
                <cfargument name="arg1">
                
                <cfreturn variables.privateOne(arg2=arguments.arg1)>

Change this to:


<cfreturn privateOne(arg2=arguments.arg1)>

and it will work!

</cffunction>

        <cffunction name="privateone" access="private">
                <cfargument name="arg2">
                        
                <cfreturn "It works">
        </cffunction>

</cfcomponent>


test.cfm <cfset test = createObject('component','test')> <cfset test.publicOne(arg1="test")>


Not sure if that is known behaviour, but it surprised me.

It is a known bug, yes.


Regards,
Sean

----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words '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