/* Define a query named qCustomer for customer scrolling. */
DEFINE VARIABLE iRow as INTEGER NO-UNDO. DEFINE QUERY qCustomer FOR customer FIELDS(address custnum name) SCROLLING. DEFINE BROWSE b QUERY qCustomer DISPLAY custnum name address WITH 10 DOWN. DEFINE BUTTON upd. OPEN QUERY qCustomer FOR EACH customer. ENABLE upd b WITH FRAME x. ON CHOOSE OF upd DO: iRow = CURRENT-RESULT-ROW("qCustomer"). GET PREV qCustomer. GET NEXT qCustomer EXCLUSIVE-LOCK. IF CURRENT-RESULT-ROW("qCustomer") = iRow THEN UPDATE customer.address WITH FRAME z VIEW-AS DIALOG-BOX. /* else, indicate that an error occurred: the record was deleted in the meantime. */ DISPLAY customer.address WITH BROWSE b. END. WAIT-FOR WINDOW-CLOSE OF CURRENT-WINDOW. |