我寫了一個簡單的代碼來從數據庫中搜索一些數據並將其顯示在瀏覽器(br1)中,它包含以下佈局screenshot如何編寫取消按鈕的代碼撤消/回滾添加和更新正在進行的行4gl
DO:
Enable
oadd oupdate odelete ocancel with frame default-frame.
Find First Customer where Customer.Cust-Num =input oCustNum exclusive-lock NO-ERROR .
if available customer
THEN DO:
message "1" view-as alert-box.
update
Customer.Name = input oName
Customer.Balance = input oBalance
Customer.Discount = input oDiscount
Customer.Credit-Limit = input oCredit-Limit
Customer.Phone = input oPhone
Customer.Contact = input oContact .
br1:refresh().
end.
if not available customer
THEN DO:
message "2" view-as alert-box.
Create Customer.
assign
Customer.Cust-Num = input oCustNum
Customer.Name = input oName
Customer.Balance = input oBalance
Customer.Discount = input oDiscount
Customer.Credit-Limit = input oCredit-Limit
Customer.Phone = input oPhone
Customer.Contact = input oContact .
end.
END.
我寫了保存更新的代碼並添加到保存按鈕。
現在當按下取消按鈕時,我需要在添加/更新完成之前撤銷/回滾數據到原始值。
任何人都可以幫助我嗎?
這是答案嗎?它沒有任何意義... – Jensd
而不是m_can你可以使用你的取消按鈕撤消任何你想要通過在你的程序中使用標籤這僅僅是一個例子 –