|
下面的代码是我理解的类
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
[ 本帖最后由 onlonely 于 2009-6-13 11:31 编辑 ] |
|