Well I pass objects all the time, but in the case of a result
function typically i'd want to call a method in the components
specifically.
Here is a simplified example of what I'm trying to do
<cfset userObj = createObject('component',
'extensions.components.user.user').init(userkey)>
<cfset test = userObj.getUserTypeInCenter>
<cfdump var="#test#">
<cfset test(userObj.defaultCenters.pc)>
The cfdump will show that test is a function, however it does not
keep the values that are passed to the component. It returns an error
saying that certain variables that are defined in the init are not
defined. However doing this instead works fine:
<cfset userObj = createObject('component',
'extensions.components.user.user').init(userkey)>
<cfset userObj.getUserTypeInCenter(userObj.defaultCenters.pc)>
How I ended up making it work was passing a struct like this
struct.component = userObj
struct.method = "create"
Then on the resulting function I do
<cfinvoke component="#result.component#" method="#result.method#">
Thanks for all the replies, it seems that ColdFusion is so close to
doing it right, to me this seems like a very clean way to pass result
messages. Let me know if anyone thinks I'm doing it wrong, I'd love
to stand corrected.
Kenton
On Nov 2, 2005, at 12:40 PM, Raymond Camden wrote:
> Another example is QuickSort at CFLIB:
>
> http://www.cflib.org/udf.cfm?ID=518
>
> On 11/2/05, Ben Forta <[EMAIL PROTECTED]> wrote:
>> Actually, you can indeed pass the name of a function to another
>> function,
>> perhaps as a callback (a bit like using pointers to functions in C).
>>
>> I used this technique in an XML based menuing app I wrote a while
>> back.
>> Details are at
>> http://www.macromedia.com/devnet/coldfusion/extreme/xml_menu.html.
>>
>> --- Ben
>>
>
>
> --
> ======================================================================
> =
> Raymond Camden, Director of Development for Mindseye, Inc
> (www.mindseye.com)
>
> Member of Team Macromedia (http://www.macromedia.com/go/
> teammacromedia)
>
> Email : [EMAIL PROTECTED]
> Blog : ray.camdenfamily.com
> Yahoo IM : cfjedimaster
>
> "My ally is the Force, and a powerful ally it is." - Yoda
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking
application. Start tracking and documenting hours spent on a project or with a
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:222971
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54