Using VPLUS: An Introduction to Forms Design (32209-90004)
5-11
Press FIELD TOGGLE. Type the SET TO statement shown in Figure 5-7 in the
processing specification area. Press ENTER.
The SET TO statement calculates the value of TPRICE from UPRICE and QTY.
The data type for TPRICE is already NUM2 so it need not be changed. Note
that the data types of QTY and UPRICE are already numeric; QTY is type
DIG and UPRICE is NUM2.
As a result of this specification, the user need only enter values in the
QTY field and the UPRICE field. When ENTER is pressed, ENTRY calculates
the total price for the TPRICE field and transfers it to the batch record
with the other data from this form. The user does not see the calculated
value unless using Browse mode to review the data.
Any field used in a calculation must have a value when the calculation is
performed. If it has no value, then the calculation is skipped. In this
exercise, the values of the QTY and UPRICE fields are both required
(FType of R) so that the calculation of TPRICE is always performed.
Figure 5-8. Field Menu for ORDATE in the TOTALS Form
DEFINE FIELDS FOR THE TOTALS FORM
Now that the display-only fields in the ORDER form are defined, you need
to define the display-only fields for the TOTALS form in a similar
manner.