我的程序里有“开始”“暂停”按钮,为什么暂停按钮点不了?
“开始”里相关代码:
li_count = dw_1.rowcount()
//li_n2 =li_count - li_count2
for li_n = 0 to li_count
sleep (1)
yield ()
//select max(num)
//into :li_id
//from customer
//using bizbakdb;
li_id = li_id + 1
li_count2 =dw_2.rowcount()
select count (num)
into :li_count2
from customer
using bizbakdb;
//sle_1.text = string ( li_count2 )
SELECT *
// "customer"."num",
// "customer"."name",
// "customer"."telephone",
// "customer"."address",
// "customer"."conperson"
into :li_num,
:ls_name,
:li_telephone,
:ls_address,
:ls_conperson,
:ls_beizhu
FROM customer
where num = :li_id
using sqlca;
INSERT INTO customer
// ( "num",
// "name",
// "telephone",
// "address",
// "conperson" )
VALUES ( :li_num,
:ls_name,
:li_telephone,
:ls_address,
:ls_conperson,
:ls_beizhu)
UPDATE customer
SET beizhu = "已导入"
using bizbakdb;
commit using bizbakdb;
IF ib_stop_flag = true then
//ib_stop_flag = FALSE
rollback;
rollback using bizbakdb;
//终止并退出
messagebox("暂停","PAUSE!")
return
END IF
If bizbakdb.SQLCode <> 0 Then
Rollback;
rollback using bizbakdb;
MessageBox("Error","导入失败。。。")
return
end if
//IF ib_stop_flag = true then
// //ib_stop_flag = FALSE
// rollback;
// rollback using bizbakdb;
// //终止并退出
// messagebox("暂停","PAUSE!")
// return
//END IF
sle_1.text = string ( li_count2 )
next;
//If bizbakdb.SQLCode <> 0 Then
// Rollback;
// rollback using bizbakdb;
// MessageBox("Error","导入失败。。。")
// return
//end if
// commit;
// commit using bizbakdb;
messagebox("congratuation","导入成功!")
“暂停”里的代码:
//boolean ib_stop_flag
ib_stop_flag = true
//rollback;
------解决方案--------------------
你把暂停的代码写到开始中了
IF ib_stop_flag = true then
//ib_stop_flag = FALSE
rollback;
rollback using bizbakdb;
//终止并退出
messagebox("暂停","PAUSE!")
return
END IF
把你的这段代码放到暂停里面