This isn't necessarily "unreasonable" -- though, I see your point....
<cfscript>
//make a cfc instance
cfc = createObject("component","test");
//1)set the name of a method
//2)make a temporary method that references it
//3)call the temp method
methodName = "getFoo";
cfc.tempMethod = cfc[methodName];
cfc.tempMethod();
//for completeness, kill the temp method
structDelete(cfc,"tempMethod");
</cfscript>
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Behalf Of Paul Kenney
> Sent: Monday, January 19, 2004 9:27 AM
> To: [EMAIL PROTECTED]
> Subject: RE: [CFCDev] <cfobject> and <cfinvoke> VS createObject
>
>
> Another reason to use <cfinvoke> is that it allows you to call a
> method that
> isn't known until runtime.
>
> <cfset object = CreateObject("component", "com.somecomponent")>
> <cfset method = "bar">
>
> <cfinvoke component="#object#" method="#method#">
>
> You can't really do this in a reasonable fashion using the
> procedural style.
>
>
> Paul Kenney
> WebMaster, CorporateWarriors.com
> 916-663-1963
>
>
----------------------------------------------------------
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]