对winlistview类型的对象,我们往往需要做以下处理
1、查看list中包含的所有数据
2、将数据信息分隔,便于查询
3、判断是否存在期望数据值
对上述三点内容,我做了一个简要的样例,可以参考使用:
'通过GetContent方法,把WinListView中的数据取回来,这时返回的是一串字符串
t_test=browser("Browser").Dialog("选择文件").WinListView("请选择文件。").GetContent
msgbox t_test
'字符串中,数据间通过换行符进行分隔,这样通过split方法,把数据存入数组
'vblf是换行符号,与之对应的vbcr是回车符号
t_test_array=split(t_test,vblf)
msgbox t_test_array(0)
'ubound获取数组上标
arraycount=ubound(t_test_array)
msgbox arraycount
'使用for each...in...判断期望数据是否在数组中
v_value="test"
For eachv_valueint_test_array
msgbox "hehe"
Exit for
Next