>- see footer for list info -<
I posted a similar message on Ray Camden's Ask a Jedi blog but it created
more questions than answers. I need to return at least 2 complex objects
(queries) from a CFC. The CFRETURN function only lets you return a single
object/variable so I started using the THIS scope.

Example: from within the CFC
<CFSET this.myquery=myquery>

Now myquery is exposed to the parent page so I can grab it like so:

<!--- use createobject to initiate the cfc --->
<CFSET objCFC=CreateObject("component","myCFC")>
<!--- collect a varible that CFReturn would usually return from a cfc --->
<CFSET getReturnedData=objCFC.myFunction("optional arguments go here")>
<!--- get the var/object that was explosed using the This scope --->
<CFSET myquery=objCFC.myquery>

I found this is the quickest and most effecient way to return multiple
vars/objects from CFCs without storing them in arrays or structures which
seems like a waste of code when This works with total simplicity. Someone
told me using the This scope is bad practice but failed to give a reason. I
honestly don't see what's wrong with this, but I'd like to hear the thoughts
of experienced CFC users? (I've only been using CFCs for a few months).

Thanks,
Gary.
_______________________________________________

For details on ALL mailing lists and for joining or leaving lists, go to 
http://list.cfdeveloper.co.uk/mailman/listinfo

--
CFDeveloper Sponsors:-
>- Hosting provided by www.cfmxhosting.co.uk -<
>- Forum provided by www.fusetalk.com -<
>- DHTML Menus provided by www.APYCOM.com -<
>- Lists hosted by www.Gradwell.com -<
>- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<

Reply via email to