Subclassing Question

Need some direction on how to go about this…
I have in my app an instance (gCurTester) of a custom class (tester). At one point, depending on user decisions, I may need to instantiate an instance of class CDC_tester which is a subclass of tester. When I instantiate that subclass (dim curCDCTester As new CDC_tester) how can I include/pass the values already set in gCurTester so that curCDCTester knows all of the current property values before adding its unique values?

Pass gCurTester to the constructor of curCDCTester.

Sub Constructor(t as tester)
   oneProperty = t.oneProperty
   anotherProperty = t.anotherProperty
End Sub

Pass the existing instance of the CDC_tester into the Constructor of the new one and copy the properties over.

Dang it! Tim beat me to it.

Thanks Tim and Bob. I was hoping for some clever trick to move the whole shebang at once. Not sure the subclass makes as much sense then. :slight_smile:

Depending on what you want to do you might be able to use a shared property.