Complex scope dereferencing is somewhat tricky in CF. If you use a temporary variable (as Nathan did) it'll be fine. Same thing goes for nesting recordset inside recordsets. You can't call the inner recordset directly, you have to assign it to a temporary variable first. At least if you want to loop over it in CFLOOP/CFOUTPUT.
Cheers, barneyb > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Ben Curtis > Sent: Monday, May 17, 2004 10:31 AM > To: [EMAIL PROTECTED] > Subject: Re: [CFCDev] Dynamic calling of CFC methods: opinions? > > > > I find that I occasionally end up wanting to dynamically > decide which method > > of a CFC to call. It ends up looking something like: > > > > cfcInstance.tempMethodName = cfcInstance[cfcMethodNameIWant]; > > cfcInstance.tempMethodName(whateverArgs); > > structDelete(cfcInstance,"tempMethodName"); > ... > > Any opinions on this practice? Is it a "bad thing"? > > I was going to suggest using this: > > cfcInstance[cfcMethodNameIWant](whateverArgs); > > ...but in testing I found something interesting. This dumps > a function: > > <cfdump var="#cfcInstance[cfcMethodNameIWant]#"/> > > ...but when you try to call that function, this throws a > parse error on the parens: > > <cfoutput>#cfcInstance[cfcMethodNameIWant]()#</cfoutput> > > Not what I would have expected. Why do you suppose? Is this > a bug? > > -- > > Ben Curtis > WebSciences International > http://www.websciences.org/ > v: 310 478 6648 > f: 310 235 2067 > > > > > > > ---------------------------------------------------------- > 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] > ---------------------------------------------------------- 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]
