Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 65
Default Cloning an object which contains a collection

Hi,

another OOP question: I'm implementing a Class which contains a
Collection property. Until now, all properties in my objects would be
either scalars or arrays of a basic type (Long, Double, etc.). But
now, one of them is a Collection. The Collection is used to store
String variables: I'm not trying to do something as perversed as deep
cloning of an object which contains another object which contains
other objects, etc, etc, :) How can I implement the Clone method, to
correctly clone also the Collection property? I guess I'll have to do
something like:

' Class1

Public Function Clone() As Class1
Dim Str As String
Set Clone = New Class1
'code to copy "regular" properties
For Each Str in Me.ErrString 'ErrString is the Collection inside
Class1
Clone.ErrString.Add Str
Next
End Sub

Is this the best way? Thnx,

Best Regards

deltaquattro
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Collection Object Chip Pearson Excel Programming 2 September 11th 09 11:22 PM
Collection Object Patrick Molloy[_2_] Excel Programming 2 September 11th 09 12:46 PM
How to track object index in object collection JE McGimpsey Excel Programming 0 June 10th 08 06:01 PM
Adding Name object to a collection does not add an object Tim Richardson Excel Programming 5 October 8th 06 01:28 PM


All times are GMT +1. The time now is 10:38 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"