DEFINE VARIABLE cCustomer AS CHARACTER NO-UNDO INITIAL "WILNER".
DEFINE VARIABLE hRequest AS HANDLE NO-UNDO. DEFINE VARIABLE hServer AS HANDLE NO-UNDO. DEFINE VARIABLE lReturn AS LOGICAL NO-UNDO. CREATE SERVER hServer. lReturn = hServer:CONNECT("-URL http://slater:OuterLimits64@zeus:8810/inventory/apsv"). RUN server.p ON hServer ASYNCHRONOUS SET hRequest EVENT-PROCEDURE "GetCustNum" (INPUT cCustomer, OUTPUT iCustomer AS INTEGER). WAIT-FOR PROCEDURE-COMPLETE OF hRequest. DELETE OBJECT hRequest NO-ERROR. hServer:DISCONNECT(). DELETE OBJECT hServer NO-ERROR. PROCEDURE GetCustNum: DEFINE INPUT PARAMETER piCustomer AS INTEGER NO-UNDO. DISPLAY piCustomer. END. |
DEFINE INPUT PARAMETER pcCustomer AS CHARACTER NO-UNDO.
DEFINE OUTPUT PARAMETER piCustomer AS INTEGER NO-UNDO. FOR FIRST customer WHERE customer.name = pcCustomer NO-LOCK: piCustomer = customer.cust-num. END. |