P portroe Dec 2, 2003 #1 What would be a typical scenario or real-world reason to us Overload constructs, thanks portroe
O One Handed Man [ OHM ] Dec 2, 2003 #2 You might want to initialise class with or without setting values Dim P = New cPreset( 20 ) Dim P2 = New cPreset() Class cPreset Dim presetValue as Integer Sub New ( iPresetValue as Integer ) PresetValue=iPresetValue ' Value passed End Sub Sub New ( ) PresetValue=10 ' Default End Sub End Class What would be a typical scenario or real-world reason to us Overload constructs, thanks portroe Click to expand... Best Regards - OHMBest Regards - OHM (e-mail address removed)
You might want to initialise class with or without setting values Dim P = New cPreset( 20 ) Dim P2 = New cPreset() Class cPreset Dim presetValue as Integer Sub New ( iPresetValue as Integer ) PresetValue=iPresetValue ' Value passed End Sub Sub New ( ) PresetValue=10 ' Default End Sub End Class What would be a typical scenario or real-world reason to us Overload constructs, thanks portroe Click to expand... Best Regards - OHMBest Regards - OHM (e-mail address removed)
H Herfried K. Wagner [MVP] Dec 2, 2003 #3 * portroe said: What would be a typical scenario or real-world reason to us Overload constructs, Click to expand... For example, passing data which is needed to instantiate an object. Have a look at the classes in the .NET framework and you will see when overloading the ctor makes sense.
* portroe said: What would be a typical scenario or real-world reason to us Overload constructs, Click to expand... For example, passing data which is needed to instantiate an object. Have a look at the classes in the .NET framework and you will see when overloading the ctor makes sense.