billrub 发表于 2004-10-7 21:56:29

头文件引用错误,请求急援!

我在录制了一段脚本后,并引入datapool,也对“sqautil.sbh”进行了头文件引用说明,可依然出现了错误:
对“sqautil.sbh”文件中的一系列DECLARE语句指出了同一错误“ILLEGAL STATEMENT!”
望高手不吝赐教!

hxf 发表于 2004-10-8 13:26:26

请把你的脚本和错误写清楚。

billrub 发表于 2004-10-8 15:28:00

脚本

Sub Main
    '$Include "SQAUTIL.SBH"
    Dim Result As Integer
    dim x as integer
    dim dp as long
    dim user as string
    dim pw as string
    dp = sqadatapoolopen("test");
    for x =1 to 5
    call sqadatapoolfetch(dp)
    call sqadatapoolvalue(dp,1,user)
    call sqadatapoolvalue(dp,2,pw)

    'Initially Recorded: 2004-9-2710:14:08
    'Script Name: new1
   
    Window SetContext, "Class=Shell_TrayWnd", ""
    Toolbar Click, "ObjectIndex=2;\;ItemText=Æô¶¯ Internet Explorer ä¯ÀÀÆ÷", "Coords=8,16"
   
    Window SetContext, "Caption=about:blank - Microsoft Internet Explorer", ""
    ComboBox Click, "ObjectIndex=4", "Coords=830,4"
    ComboListBox VScrollTo, "ObjectIndex=4", "Position=1"
    ComboListBox Click, "ObjectIndex=4", "ItemData=1731544"
    Browser SetFrame,"Type=HTMLFrame;HTMLId=mainFrame",""
    Browser NewPage,"HTMLTitle=¾­¼Ã»§¿Ú×ۺϹÜÀí-¼à¹Üϵͳ",""
    EditBox Click, "Type=EditBox;Name=loginName", "Coords=40,11"
    InputKeys user
    HTMLTable Click, "Type=HTMLTable;Index=3", "Row=1;Col=4"
    EditBox Click, "Type=EditBox;Name=password", "Coords=66,9"
    InputKeys pw
    PushButton Click, "Type=PushButton;Name=Submit"
    Window CloseWin, "", ""
    next x
    call sqadatapoolclose(dp)
End Sub

billrub 发表于 2004-10-8 15:29:22

错误

以下是错误提示:
Compiling new1.rec...
SQAUTIL.SBH(5) Error: Illegal statement
SQAUTIL.SBH(17) Error: Illegal statement
SQAUTIL.SBH(18) Error: Illegal statement
SQAUTIL.SBH(20) Error: Illegal statement
SQAUTIL.SBH(21) Error: Illegal statement
SQAUTIL.SBH(23) Error: Illegal statement
SQAUTIL.SBH(25) Error: Illegal statement
SQAUTIL.SBH(26) Error: Illegal statement
SQAUTIL.SBH(27) Error: Illegal statement
SQAUTIL.SBH(28) Error: Illegal statement
SQAUTIL.SBH(30) Error: Illegal statement
SQAUTIL.SBH(31) Error: Illegal statement
SQAUTIL.SBH(32) Error: Illegal statement
SQAUTIL.SBH(35) Error: Illegal statement
new1.rec(9) Error: Variable sqadatapoolopen undefined
new1.rec(11) Error: Unknown function: sqadatapoolfetch
new1.rec(12) Error: Unknown function: sqadatapoolvalue
new1.rec(13) Error: Unknown function: sqadatapoolvalue
new1.rec(35) Error: Unknown function: sqadatapoolclose
0 warning(s), 19 error(s)

pcl2004_27 发表于 2004-10-10 11:00:43

你把头文件放在了脚本中,应该修改为

'$Include "SQAUTIL.SBH"   

Sub Main
      Dim Result As Integer
    dim x as integer
    dim dp as long
    dim user as string
    dim pw as string
    dp = sqadatapoolopen("test");
    for x =1 to 5
    call sqadatapoolfetch(dp)
    call sqadatapoolvalue(dp,1,user)
    call sqadatapoolvalue(dp,2,pw)

    'Initially Recorded: 2004-9-2710:14:08
    'Script Name: new1
   
    Window SetContext, "Class=Shell_TrayWnd", ""
    Toolbar Click, "ObjectIndex=2;\;ItemText=Æô¶¯ Internet Explorer ä¯ÀÀÆ÷", "Coords=8,16"
   
    Window SetContext, "Caption=about:blank - Microsoft Internet Explorer", ""
    ComboBox Click, "ObjectIndex=4", "Coords=830,4"
    ComboListBox VScrollTo, "ObjectIndex=4", "Position=1"
    ComboListBox Click, "ObjectIndex=4", "ItemData=1731544"
    Browser SetFrame,"Type=HTMLFrame;HTMLId=mainFrame",""
    Browser NewPage,"HTMLTitle=¾­¼Ã»§¿Ú×ۺϹÜÀí-¼à¹Üϵͳ",""
    EditBox Click, "Type=EditBox;Name=loginName", "Coords=40,11"
    InputKeys user
    HTMLTable Click, "Type=HTMLTable;Index=3", "Row=1;Col=4"
    EditBox Click, "Type=EditBox;Name=password", "Coords=66,9"
    InputKeys pw
    PushButton Click, "Type=PushButton;Name=Submit"
    Window CloseWin, "", ""
    next x
    call sqadatapoolclose(dp)
End Sub

billrub 发表于 2004-10-10 12:11:08

thks

xiang0522 发表于 2005-3-24 15:30:58

终于知道错误的原因了!谢谢!
页: [1]
查看完整版本: 头文件引用错误,请求急援!