03-06-2014 04:13 AM
I'm using DIAdem for making large PDF reports based on measurement data. I'm using classes, but it would be a big advantage to have class inheritance functionalities. As far as I know VBS doesn't provide inheritance functionalities (i'm not so familiar with VBS). Is there any possibility to use class inheritance in DIAdem for generating reports?
Thanks
Raphael
03-06-2014 04:28 AM
There is no inheritance in VBS.
But because VBS is name oriented something like a virtual interface works out.
Option Explicit
class A
Sub SayMyName()
Msgbox "I am A"
End Sub
end class
class B
Sub SayMyName()
Msgbox "I am B"
End Sub
end class
Sub LetItTalk(ByRef obj)
obj.SayMyName
End Sub
dim aObj : set aObj = new A
dim bObj : set bObj = new B
LetItTalk(aObj)
LetItTalk(bObj)
So LetItTalk works with any class that implements the SayMyName method.
03-07-2014 08:07 AM
Hi Andreas
Thanks for the answer, it works like that.
Regards
Raphael