Chris Stoner said the following on 3/22/2006 1:03 PM:
On 3/22/06, Ed Griffiths <[EMAIL PROTECTED]> wrote:
Hi

We're looking into an issue with a CFC which has raised the following
questions:

- Are variables that are returned from CFC methods returned by value or
reference?

That Depends on the type of variable.
- structures, cfc instances and java object instances are passed by reference.
- simple variables (string, numeric, etc) and arrays are passe by value.  Arrays are passed by value as shallow copies (meaning any structures or objects inside the array are passed by reference).
Right on!
 

- Is this value/reference outcome dependent on the CFC method's specified
returnType (are objects returned in a different way from, say, arrays or
structs?)

Nope it's dependent on the type of variable as described above.  Structures are returned as a reference an string is returned by value.
Chris is correct.

- Is there an Adobe TechNote or similar doc on this subject that we've
overlooked?

Probably.
I'm sure it's described somewhere in the doco whether it is a TechNote or LiveDocs - you'd have to search for it.
- Has this behaviour changed between CF versions or hotfixes?

Don't think so but could be wrong.
I don't think you are wrong - IIRC, most languages pass variables around in a similar method to CF.  Until recent version IIRC, php suffered from passing objects by value instead of ref.  What a pain!  (As you can see, I don't do much PHP)...
-- 
Peter J. Farrell :: Maestro Publishing
Member Team Mach-II :: Member Team Fusion
http://blog.maestropublishing.com

Create boilerplate beans and transfer objects for ColdFusion!
Fire up a cup of Rooibos!
http://rooibos.maestropublishing.com/

----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com).

An archive of the CFCDev list is available at www.mail-archive.com/[email protected]

Reply via email to