|
Class AddNew
Dim obj,text,x1,y1,x2,y2
Sub Class_Initialize
obj = "aa"
text = "text"
x1 = 0
y1=0
x2=0
y2=0
End Sub
Sub setPara1(byval objactual)
obj = objactual
End Sub
Sub setPara2(byval textactual)
text = textactual
End Sub
//x1,x2,y1,y2的设置函数同样写
Sub setx1(byval x1actual)
x1= x1actual
End Sub
Sub DoAdd()
msgbox "obj=[" & obj& "] text=[" & text& "] x1=[" & x1 & "]"
End Sub
End Class
Set Customer = new AddNew
Customer.setPara1("aa")
Customer.setPara2("text")
Customer.DoAdd()
Set Customer = nothing
如果要传x1,x2等则增加
customer.setx1();
customer.setx2()等函数,并在Customer.DoAdd()前设置其值
想用x1,y1等就设置下,不想用就不设置,使用默认的初始值,所以默认的初始值设置是需要考虑的,
不知道这样是否能理解 |
|