0
奥基,这里是我的问题,即时通讯使用一个字符串来检查我需要访问哪一个调用名为K0至K6一堆不同propertys的,即时通讯,这是该死的凌乱,我怎么能做到这一点更清洁的方式?我相信字符串不是要走的路,所以请给我一个评论,以便朝着正确的方向前进。我怎样才能做到这一点propertycall以更好的方式?
Dim tempAntDec As Integer
Select Case wd.MClass
Case "K0"
tempAntDec = wd.allMeasUnc.K0.antDec
Case "K1"
tempAntDec = wd.allMeasUnc.K1.antDec
Case "K2"
tempAntDec = wd.allMeasUnc.K2.antDec
Case "K3"
tempAntDec = wd.allMeasUnc.K3.antDec
Case "K4"
tempAntDec = wd.allMeasUnc.K4.antDec
Case "K4-5"
tempAntDec = wd.allMeasUnc.K4_5.antDec
Case "K5"
tempAntDec = wd.allMeasUnc.K5.antDec
Case "K5-6"
tempAntDec = wd.allMeasUnc.K5_6.antDec
Case "K6"
tempAntDec = wd.allMeasUnc.K6.antDec
End Select
我想一些其他方式喜欢叫这个,这个..还是不知道,但我觉得有一种更好的方式来处理呢?
tempAntDec = wd.allMeasUnc.KValue.antDec
你可以替换枚举的字符串。 – JeffO 2012-02-03 01:37:52