|
先看录制的一段程序,过程很简单就是打开一个notepad,输入内容并保存,为了节省时间没有设置验证点,脚本间用到了头文件的引用和参数传递。
头文件:notepadheader.sbh
const winname = "Caption=未定标题 - 记事本"
脚本一:notepad01
'$include:"notepadheader.sbh"
declare sub inputnew basiclib "notepadinput" (inputstring as string,inputname as string)
Sub Main
Dim Result As Integer
'Initially Recorded: 2005-4-18 16:42:55
'Script Name: notepad01
dim inputstring as string
dim inputname as string
inputstring = "aaa"
inputname = "01"
call inputnew(inputstring,inputname)
End Sub
脚本二:notepadinput
'$include:"notepadheader.sbh"
declare sub inputnew(inputstring as string,inputname as string)
Sub inputnew(inputstring as string,inputname as string)
Dim Result As Integer
'Initially Recorded: 2005-4-18 16:46:34
'Script Name: notepadinput
StartApplication "E:\NOTEPAD.EXE"
Window SetContext, winname, "" '引用头文件中的定义的变量
InputKeys inputstring
MenuSelect "文件(F)->保存(S)"
Window SetContext, "Caption=另存为", ""
ComboEditBox Left_Drag, "ObjectIndex=3", "Coords=75,5,-77,13"
InputKeys inputname
PushButton Click, "Text=保存(S)"
End Sub
当我想把这个脚本加到另一个project中,我可以从open-〉SQABasic File中选择想要加入的脚本.rec文和头文件。在按F8单步执行可以看到,加入过来的脚本引用头文件中定义的数值和参数传递都是可以的,但执行到notepadinput中的输入那段语句时(InputKeys inputstring)就停住了,不知道是哪里有问题了,那位大虾能帮助解答一下,谢谢 |
|