TO-ROWID ( rowid-string )
|
DEFINE VARIABLE hcustb AS HANDLE NO-UNDO.
DEFINE VARIABLE irow AS INTEGER NO-UNDO. DEFINE QUERY custq FOR Customer. DEFINE BUFFER cust2 FOR Customer. DEFINE TEMP-TABLE rowtab FIELD rowchar AS CHARACTER INDEX rowi IS UNIQUE PRIMARY rowchar ASCENDING. DEFINE BROWSE custb QUERY custq DISPLAY Customer.CustNum Customer.Name Customer.Balance Customer.CreditLimit WITH 10 DOWN MULTIPLE. DEFINE BUTTON bstore LABEL "Store Selections". DEFINE BUTTON bdisplay LABEL "Display Call Selections". DEFINE BUTTON bclear LABEL "Clear Storage". DEFINE FRAME brs-frame custb SKIP bstore bdisplay bclear. DEFINE FRAME dsp-frame cust2.CustNum cust2.Name cust2.Phone WITH 5 DOWN SCROLL 1. ON CHOOSE OF bstore DO: DO irow = 1 TO custb:NUM-SELECTED-ROWS: IF custb:FETCH-SELECTED-ROW(irow) AND NOT CAN-FIND(rowtab WHERE STRING(ROWID(Customer)) = rowchar) THEN DO: CREATE rowtab NO-ERROR. ASSIGN rowchar = STRING(ROWID(Customer)) NO-ERROR. END. END. END. ON CHOOSE OF bdisplay DO: CLEAR FRAME dsp-frame ALL. FOR EACH rowtab WITH FRAME dsp-frame: FIND cust2 WHERE ROWID(cust2) = TO-ROWID(rowchar). DISPLAY cust2.CustNum cust2.Name cust2.Phone. DOWN WITH FRAME dsp-frame. END. END. ON CHOOSE OF bclear DO: IF custb:DESELECT-ROWS() THEN FOR EACH rowtab: DELETE rowtab. END. FRAME dsp-frame:VISIBLE = FALSE. END. OPEN QUERY custq PRESELECT EACH Customer. ENABLE ALL WITH FRAME brs-frame. WAIT-FOR WINDOW-CLOSE OF CURRENT-WINDOW. |