|
Call Testcase
Class Standard_Caculation
Dim a,b,c
Sub Class_Initialize
MsgBox "Welcome everyone!"
End Sub
Sub Class_Terminate
Msgbox"Goodbye everyone!"
End Sub
Sub Addition(a,b)
c= a+b
If c=3 Then
msgbox("The result is correct.")
else
msgbox("The result is wrong!")
End If
End Sub
Sub Subtraction(a,b)
c=a-b
If c=2 Then
msgbox("The result is correct.")
else
msgbox("The result is wrong!")
End If
End Sub
Sub Divide(a,b)
c=a/b
If c=2 Then
msgbox("The result is correct.")
else
msgbox("The result is wrong!")
End If
End Sub
Sub Multiply(a,b)
c=a*b
If c=8 Then
msgbox("The result is correct.")
else
msgbox("The result is wrong!")
End If
End Sub
End Class
Sub Testcase()
set result=New Standard_Caculation
result.Addition 1,2
result.Subtraction 3,1
result.Divide 4,2
result.Multiply 4,2
Set result=Nothing
End Sub
本人对于Class的理解只是初级,希望大家拍砖!!! |
|