<cfset users = users />
When a method returns an object (query, structure, CFC instance) it
passes by reference, so it just hands back a reference to the same
object in memory. Simple types (strings, numbers, dates, and arrays)
are passed by value, so they actually make a new copy of the value.
cheers,
barneyb
On Thu, 23 Sep 2004 14:09:16 -0400, Don Chunshen Li
<[EMAIL PROTECTED]> wrote:
> Here's a simple cfc function:
> <!--- List users method --->
> <CFFUNCTION NAME="List"
> RETURNTYPE="query"
> HINT="Get complete user list">
>
> <!--- Get users --->
> <CFQUERY NAME="users" DATASOURCE="exampleapps">
> SELECT EmployeeID AS UserID, FirstName, LastName
> FROM tblEmployees
> ORDER BY LastName, FirstName
> </CFQUERY>
>
> <CFRETURN users>
> </CFFUNCTION>
>
> Now, do you think "CFRETURN users" is the equivalent of
> <cfset users = Duplicate(users)>
> or
> <cfset users = StructCopy(users)>
> another OR probably is not very likely.
>
> Though in most cases, I believe both would return same resultsets.
>
--
Barney Boisvert
[EMAIL PROTECTED]
360.319.6145
http://www.barneyb.com
I currently have 6 GMail invites for the taking
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

