First thing that comes to mind is to remove the period (.) between [myname]
and [mymethod]

<cfset z = application[myname][mymethod](argumentCollection =
"#arguments#")>

-- 
William E. Seiter
 
Have you ever read a book that changed your life?
Go to: www.winninginthemargins.com
Enter passkey: goldengrove
 
Web Developer / ColdFusion Programmer
http://William.Seiter.com

-----Original Message-----
From: Andrew Grosset [mailto:[EMAIL PROTECTED] 
Sent: Sunday, February 10, 2008 9:48 AM
To: CF-Talk
Subject: Passing method/function name to CFC

I have a cfc in the application scope initiated on application start

<cfset application.myImage = createObject("component","mycfcs.ImageStuff")>

I can then access the methods/functions like so:

(Z returns a boolean indicating weather the image was successfully rotated)

<cfset z = application.myImage.rotateImage(argumentCollection =
"#arguments#")>

I am trying to dynamically pass the cfc name and function like so:

<cfset myname = "myImage">
<cfset mymethod = "rotateImage">

Here I am just passing in the cfc name and it works:

<cfset z = application[myname].rotateImage(argumentCollection =
"#arguments#")>

The problem is I cannot find a way to pass in the function name...something
like this..which does not work:

<cfset z = application[myname].[mymethod](argumentCollection =
"#arguments#")>

which gives an error: "Invalid CFML construct".

any suggestions appreciated,

thanks, Andrew Grosset. 



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

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

Reply via email to