|
楼主,我完全照你的做法做了一个windows自带计算器的例子给你希望你能好好的研究一下,不难的,相信研究后对你很有用。另外真是佩服楼主的精神。自己一点都不想去想想的吗?
我的数据池数据是一列字段
2
6
8
脚本代码:
'$Include "sqautil.sbh"
Sub Main
Dim Result As Integer
'Initially Recorded: 2009-2-18 16:47:20
'Script Name: test3
Dim dp_id,dp_Result as long
Dim Str1 as string
Dim i as integer
dp_id = SQADatapoolOpen ("51test", FALSE, SQA_DP_SEQUENTIAL, FALSE)
call SQADatapoolFetch (dp_id)
call SQADatapoolValue(dp_id,1,Str1)
' call SQADatapoolRewind (dp_id)
msgbox Str1
Window SetContext, "Caption=计算器", ""
PushButton Click, "Text=1"
PushButton Click, "Text=+"
PushButton Click, "Text=1"
PushButton Click, "Text=="
Window SetTestContext, "Caption=计算器", ""
Result = EditBoxVP (CompareNumeric, "ObjectIndex=1", "VP=Alphanumeric;Value=" & Str1)
Window ResetTestContext, "", ""
if Result=0 then
sqalogmessage sqaWarning,"计算机验证失败",""
end if
msgbox Result
call SQADatapoolFetch (dp_id)
call SQADatapoolValue(dp_id,1,Str1)
msgbox Str1
Window SetContext, "Caption=计算器", ""
PushButton Click, "Text=3"
PushButton Click, "Text=+"
PushButton Click, "Text=3"
PushButton Click, "Text=="
Window SetTestContext, "Caption=计算器", ""
Result = EditBoxVP (CompareNumeric, "ObjectIndex=1", "VP=Alphanumeric;Value=" & Str1)
Window ResetTestContext, "", ""
if Result=0 then
sqalogmessage sqaWarning,"计算机验证失败",""
end if
msgbox Result
dp_Result = SQADatapoolClose (dp_id)
end sub |
|