DEFINE VARIABLE iRow AS INTEGER NO-UNDO.
DEFINE QUERY q FOR customer FIELDS (custnum name address) SCROLLING NO-LOCK. DEFINE BROWSE b QUERY q DISPLAY custnum name address WITH 10 DOWN. DEFINE BUTTON upd. OPEN QUERY q FOR EACH customer NO-LOCK. ENABLE upd b WITH FRAME x. ON CHOOSE OF upd DO: iRow = CURRENT-RESULT-ROW("q"). GET PREV q. GET NEXT q EXCLUSIVE-LOCK. IF CURRENT-RESULT-ROW("q") EQ 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. |