Results 1 to 2 of 2

Thread: Set Class1 = Class2

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Sep 1999
    Location
    Phoenix, az
    Posts
    1,517

    Question Set Class1 = Class2

    When I use this 'Set Class1 = Class2' if the same 2 objects are the same class it works, but then if I change the first one.. The second one changes to.

    How do I copy all the information in the same manor, but keep
    the indepenance for each class?

  2. #2
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758
    You need to create a new instance of the class and then set each property manually. Typically accomplished by creating a Copy method in your class

    Something like

    VB Code:
    1. 'Class 1
    2.  
    3. Public Function Copy() as Class1
    4.    Set Copy = new Class1
    5.    With Copy
    6.        .Property1 = me.Property1
    7.        .Property2 = me.Property2
    8.        .Property3 = Some Default value
    9.    End With
    10. End Function

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width