Using VPLUS: An Introduction to Forms Design (32209-90004)
7-14
Figure 7-12. The Field Menu for TPRICE
ACCUMULATE TOTALS
In the previous version of ORDFORM1, the total price for the order was
calculated and stored in the TPRICE field. This value was then
transferred to the TOTNET field in the next form. Now that the order
line is a repeating form, you must accumulate the individual values
calculated for the TPRICE field in the ORDER_LINE form and transfer the
total amount of all the orders to the TOTNET field in the ORDER_TOTALS
form.
The field specifications on TPRICE are currently specified as:
SET TPRICE TO QTY * UPRICE
SET STOTNET
These statements calculate a value for the order line and then save this
value in the STOTNET save field, which allows you to store the total
price calculated for a single order line. The next step is to accumulate
the total price for all order lines.
Action
Change the second statement on the Field Menu for TPRICE as shown in
Figure 7-12. Press ENTER.
This statement increments the current value of the STOTNET save field by
the calculated value in TPRICE. As the ORDER_LINE form is repeated a new