Class FF
dim jynumber
dim lvnumber
Dim gwbs
Private Sub Class_Initialize() '申明的时候赋初始值
jynumber=1
lvnumber=1
gwbs=1
end sub
Function dg(dgnumber,Optional gwbs as Integer=1)'这里还是不能使用可选参数的申明
jynumber=jynumber+dgnumber*gwbs
If jynumber>10 Then
lvnumber=lvnumber+1
End If
End Function
Public Property Let lv(newID) 'lv属性的赋值
lvnumber = lvnumber+ newID
End Property
Public Property Get lv() 'lv属性的取值
lv = lvnumber
End Property
End Class
'使用上面的类FF
Set ss=new FF
call ss.dg(9)
print ss.lv
print ss.jy
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) | Powered by Discuz! X3.2 |