小白求助大神,调用vbs脚本后出现错误General run error
测试的是window上的程序,不是web,想调用vbs脚本中的返回值arrxput和arryput,但是在调用vbs脚本中的selectprovince()出现General run error,求大神帮忙。。Vbs脚本通过resource调用的,求大神帮帮忙action代码入下:
Dim arrx,arry
Dim i '循环次数
Set shell=CreateObject("Wscript.Shell")
Shell.Run"F:\【pc】\Tcar2\pc\client_tcar_pc.exe"
Window("CJTNavi_2").VirtualButton("button_zhan").Click
Window("CJTNavi_2").VirtualButton("button_menu").Click
Window("CJTNavi_2").VirtualButton("button_mainsearch").Click
Window("CJTNavi_2").VirtualButton("button_province").Click
selectprovince()
Window("CJTNavi_2").VirtualButton("button_d").Click
Window("CJTNavi_2").VirtualButton("button_a").Click
Window("CJTNavi_2").VirtualButton("button_da").Click
Window("CJTNavi_2").VirtualButton("button_search2").Click
Window("CJTNavi_2").VirtualButton("button_position").Click
Vbs脚本
Function SelectProvince(arrxput,arryput)
Dim arrx,arry
Dim mycolumeX,mycolumeY
Dim toNum,fromNum
toNum=4
fromNum=0
arrx=Array("p_X1","p_X2","p_X3","p_X4","Next_X")
arry=Array("p_Y1","p_Y2","p_Y3","p_Y4","Next_Y")
Randomize
mycolumeX=Int((toNum-fromNum+1)*Rnd+fromNum)
arrxput=arrx(mycolumeX)
Randomize
mycolumeY=Int((toNum-fromNum+1)*Rnd+fromNum)
arryput =arry(mycolumeY)
End Function 当你调用selectprovince()时候,没有传给他响应的参数,也就是SelectProvince(arrxput,arryput),没传相应数目的参数VBS调用会报错的~
页:
[1]