另外:在调用这个函数SelectRegExp(obj,patrn,Button,Offset)时,对象是如何传入的呢?我没有看懂
------------------------------------------------------------------------------------------------
其中的部分代码贴出如下:
Function SelectRegExp(obj,patrn,Button,Offset)
Dim NumOfItems,i,CurrentValue,regEx,ItemToSelect,oldFilter
'初始化正则表达式
Set regEx=new RegExp
regEx.Pattern=patrn
regEx.IgnoreCase=false '区分大小写
oldFilter=Reporter.Filter '保存默认设置
Reporter.Filter=2 '仅发送错误
ItemToSelect=-1
For i=0 to NumOfItems-1
CurrentValue = obj.GetItm(i)
print "CurrentValue:"&CurrentValue
If regEx.Test(CurrentValue) Then
If (ItemToSelect<>-1) Then
SelectRegExp=-1 '表示匹配项不唯一
Reporter.Filter = oldFilter
Exit function
End If
ItemToSelect = i
End If
Next
Reporter.Filter = oldFilter '重置默认设置
'做出选择的动作
If (ItemToSelect>=0) Then
SelectRegExp = obj.Select(ItemToSelect,Button,Offset)
Else
SelectRegExp = -1
End If
End Function