> In a calling page:
> 
> <cfset theObject = CreateObject("component","dynamictest").init("James")>
> <cfset theMethodToCall = "myFunction">
> <cfset theObject.myMethod = theObject[theMethodToCall]>
> <cfset myResult = theObject.myMethod("hello")>
> <cfoutput>#myResult#</cfoutput>

Does anyone know why in CF you can't do this:
<cfset result = theObject[methodToCall]("hello") />

When you return a function, you can't then call it with arguments.

Is it because functions in CF are actually separate classes?

I like in javascript how you can do stuff like that.

-- Josh



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:307843
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to