No, CFRETURN actually passes by reference, so if you want to return a copy of
the query object, then your would have to <CFRETURN Duplicate(users)>

________________________________

From: Chunshen (Don) Li [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 23, 2004 2:09 PM
To: CF-Talk
Subject: Data returned from a cfc function

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.
________________________________
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to