PROCEDURE postOlineFill:
DEFINE INPUT PARAMETER DATASET FOR dsOrder. DEFINE VARIABLE dTotal AS DECIMAL NO-UNDO. /* Here as well "ttOline" uses the local definition for compilation but points to the ttOline table in the input parameter at run time. */ FOR EACH ttOline WHERE ttOline.OrderNum = ttOrder.OrderNum: dTotal = dTotal + ttOline.ExtendedPrice. END. ttOrder.OrderTotal = dTotal. END PROCEDURE. /* postOlineFill */ PROCEDURE postItemRowFill: DEFINE INPUT PARAMETER DATASET FOR dsOrder. DEFINE VARIABLE cItemTypes AS CHARACTER NO-UNDO INITIAL "BASEBALL,CROQUET,FISHING,FOOTBALL,GOLF,SKI,SWIM,TENNIS". DEFINE VARIABLE cType AS CHARACTER NO-UNDO. DEFINE VARIABLE iType AS INTEGER NO-UNDO. DEFINE VARIABLE iTypeNum AS INTEGER NO-UNDO. DO iType = 1 TO NUM-ENTRIES(cItemTypes): cType = ENTRY(iType, cItemTypes). IF INDEX(ttItem.ItemName, cType) NE 0 THEN ttItem.ItemName = REPLACE(ttItem.ItemName, cType, cType). END. END PROCEDURE. /* postItemRowFill */ |