D
D Miller
This may be a basic question, but it sure has me stumpted..
I have two classes, Class1 and Class2. Class 2 inherits class one. Each
class has some varibles that need to be reset from time to time, so I have
created a method call "Clear" that does that. So my question is when using
"Clear" in an instance of class two, the clear method in Class one does not
get called, is there some way of excucting both "Clear" Methods in a single
call... See the code below for what I mean...
There must be a simple way of doing this, and I suspect I'm going to feel
pretty foolish when someone points it out, but it sure has me stumped at the
moment...
Thank you,
David
Public Class1
dim mQty as integer
dim mPrice as double
Public Sub Clear
mPrice = 0
mQty =0
end sub
Public Property Price as Double
Get
return mPrice
end get
Set(ByVal Value as Double)
mPrice = Value
end set
end property
Public Property Qty as Integer
Get
return mQty
end get
Set(ByVal Value as Integer)
mQty = Value
end set
end property
end class
Public Class2
inherits Class1
dim mInvoice as integer
Public Shadows Sub Clear
' HERE IS WHERE THE QUESTION IS. IS THERE SOME WAY OF HAVING THIS
METHOD RUN THE CLEAR METHOD OF CLASS1?
mInvoice = 0
end sub
Public Property Invoice as Integer
Get
return mInvoice
end get
Set(ByVal Value as Integer)
mInvoice = Value
end set
end property
end class
i
I have two classes, Class1 and Class2. Class 2 inherits class one. Each
class has some varibles that need to be reset from time to time, so I have
created a method call "Clear" that does that. So my question is when using
"Clear" in an instance of class two, the clear method in Class one does not
get called, is there some way of excucting both "Clear" Methods in a single
call... See the code below for what I mean...
There must be a simple way of doing this, and I suspect I'm going to feel
pretty foolish when someone points it out, but it sure has me stumped at the
moment...
Thank you,
David
Public Class1
dim mQty as integer
dim mPrice as double
Public Sub Clear
mPrice = 0
mQty =0
end sub
Public Property Price as Double
Get
return mPrice
end get
Set(ByVal Value as Double)
mPrice = Value
end set
end property
Public Property Qty as Integer
Get
return mQty
end get
Set(ByVal Value as Integer)
mQty = Value
end set
end property
end class
Public Class2
inherits Class1
dim mInvoice as integer
Public Shadows Sub Clear
' HERE IS WHERE THE QUESTION IS. IS THERE SOME WAY OF HAVING THIS
METHOD RUN THE CLEAR METHOD OF CLASS1?
mInvoice = 0
end sub
Public Property Invoice as Integer
Get
return mInvoice
end get
Set(ByVal Value as Integer)
mInvoice = Value
end set
end property
end class
i