|
我现在定义了一个class:
Class Class1
Property Let Status (strFields)
JavaWIndow("Service Call").JavaList("Status").Select strStatus
End Property
Property Get Status
Status = JavaWIndow("Service Call").JavaList("Status").GetROProperty("value")
End Property
Property Let Description (strName)
JavaWIndow("Service Call").JavaEdit("Description").Set strName
End Property
Property Get Description
Description = JavaWIndow("Service Call").JavaEdit("Description").GetROProperty("value")
End Property
End Class
Dim class1
Set class1 = new Class1
现在是可以这样用class1.Status = "New", class1.Description = "nihao"
能不能:
Dim status = "Status"
Dim des = "Description"
然后通过一种方法把class1和status,des连接起来作为一个对象?????
在gyst21的提示下,解决方案如下:
取值的话可以用,Eval("class1."&status) 相当于class1.Status
Eval("class1."&des)相当于class1.Description
赋值的话可以用,val1 = "New", val2 = "nihao"
Execute("class1."&status&"=val1")相当于class1.Status = "New"
Execute("class1."&des&"=val2")相当于class1.Description= "nihao"
[ 本帖最后由 yzem99 于 2007-12-6 15:16 编辑 ] |
|