//โปรแกรมเพิ่มข้อมูลขาย 1 ระเบียน พร้อมตัดสินค้าอัตโนมัติ
use sale
go bottom
_sale = sale + 1
_cust = 0
_empl = 0
_pro = 0
_amount = 0
@ 5,5 say _sale
@ 6,5 get _cust
@ 7,5 get _empl
@ 8,5 get _pro
@ 9,5 get _amount
read
if updated()
append blank
replace sale with _sale, cust with _cust, empl with _empl
endif
use pro
locate for pro = _pro
if found()
replace amount with amount-_amount
endif