Friday, May 7, 2010

How do you create classes and objects using vbscript

Class math

Public function addition(a,b)
addition=a+b
End Function

Public function substraction(a,b)
substraction=a-b
End Function
End Class

Set mathObj=new math
msgbox mathObj.addition(2,5)
msgbox mathObj.substraction(9,3)
Set mathObj=nothing

No comments: