Using VPLUS: An Introduction to Forms Design (32209-90004)
6-14
Figure 6-11. The Field Menu for TOTNET in the TOTALS Form
The last change is to the TOTNET field in form TOTALS.
Action
First, change the field type to D for display-only and then add the
statements (shown in Figure 6-11) to transfer the calculated net price
from the ORDER form. You should delete the existing formatting
statements (JUSTIFY RIGHT and STRIP LEADING "0") since the SET statement
causes this formatting to be performed automatically. Press ENTER to
record the changes.
The SET statement must also appear in the FIELD phase to insure that the
net total is updated if changes are made in Browse mode. Statements in
the INIT phase are only executed once, therefore, if net total was
changed on the ORDERS form the new total would be carried over to the
TOTALS form by the FIELD statement.
When the TOTALS form is displayed, the total net price calculated on the
previous form (ORDER) is shown in the TOTNET field. Then, when the user
presses ENTER, the remaining values in the form are calculated, and all
values are written to the batch file. The calculated values do not
appear during data collection, but only when the batch file is browsed.