关于QTP 全局数据字典
上一篇 /
下一篇 2014-04-14 17:02:50
/ 个人分类:QTP
用数据字典形式解决关于
QTP将数组作为参数传递的需求,如下案列:
Function KeyExistsDemo
Dim d, msg ' Create some variables.
Set d = CreateObject("Scripting.Dictionary")
d.Add "a", "Athens" ' Add some keys and items.
d.Add "b", "Belgrade"
d.Add "c", "Cairo"
If d.Exists("c") Then
msg = "Specified key exists."
Else
msg = "Specified key doesn't exist."
End If
Set KeyExistsDemo = d
End Function
Function GetKeyInfo
Dim param
Set param=KeyExistsDemo
If param.Exists("a") Then
Msgbox param.Item("a")
Else
Msgbox "---"
End If
End Function
Call GetKeyInfo
收藏
举报
TAG: