PreviousNextIndex

ACCUM function

Returns the value of an aggregate expression that is calculated by an ACCUMULATE or aggregate phrase of a DISPLAY statement.

Syntax

ACCUM aggregate-phrase expression 

aggregate-phrase
expression
Example

This procedure shows a total for the extended price of each item on an order. The running total of the order is displayed as well as the order total and grand total for all orders. This procedure accumulates totals at three levels.

r-accum.p
FOR EACH Order NO-LOCK: 
  DISPLAY Order.OrderNum Order.CustNum Order.OrderDate Order.PromiseDate 
    Order.ShipDate. 
  FOR EACH OrderLine OF Order NO-UNDO: 
    DISPLAY OrderLine.LineNum OrderLine.ItemNum OrderLine.Qty 
      OrderLine.Price (OrderLine.Qty * OrderLine.Price) LABEL "Ext Price". 
    ACCUMULATE OrderLine.Qty * OrderLine.Price (TOTAL). 
    DISPLAY (ACCUM TOTAL OrderLine.Qty * OrderLine.Price) LABEL "Accum Total". 
  END. 
  DISPLAY (ACCUM TOTAL OrderLine.Qty * OrderLine.Price) LABEL "Total". 
END. 
DISPLAY (ACCUM TOTAL OrderLine.Qty * OrderLine.Price) LABEL "Grand Total" 
  WITH ROW 1. 

See also

ACCUMULATE statement, DISPLAY statement


OpenEdge Release 10.2B
Copyright © 2009 Progress Software Corporation
PreviousNextIndex