Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do i return a collection's values, instead of by reference

Status
Not open for further replies.

granni

Programmer
Nov 8, 2000
36
SG
I have a private collection in a bas module, now i have a function that returns this col

Public Function GetOldRD_Col() As Collection
Set GetOldRD_Col = mcolOldRD
End Function

it happens that the returned collection is a reference to the private collection, which i dont want.

I need to return the collection by value

Can anyone help?
 
As a collection is an object there is no way to do this inbuilt into VB. You would have to right your own 'Clone' routine that would clone the orginal collection onto a new one that you have passed into the property/method, or pass back a newly created cloned collection.

James :) James Culshaw
jculshaw@active-data-solutions.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top