DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

OOP class inheritance

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

0 Kudos
Message 1 of 3
(5,602 Views)

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.

0 Kudos
Message 2 of 3
(5,599 Views)

Hi Andreas

 

Thanks for the answer, it works like that.

 

 

Regards

 

Raphael

0 Kudos
Message 3 of 3
(5,553 Views)