Getting Started with TRANSACT (32247-90007)
Chapter 3 61
Using VPLUS and IMAGE
Adding Data to a Dataset
form, and the parallel data items have compatible data types and lengths. All of the forms
in our formsfile are shown in appendix H. The form vcustomer is also shown below:
Figure 3-2. VPLUS Form for Adding Customer Data
The program below causes the VPLUS form vcustomer to be displayed on the terminal.
After the operator fills in the blanks and presses [[ENTER]], the data is added to the
customer dataset.
Figure 3-3. Program accessing a VPLUS form
1 The option VPLS= on the SYSTEM statement specifies that the name of
our formsfile is formfile.
3 GET(FORM) displays the form on the terminal, initialize the fields, and
accepts the data entered by the user.
The example above shows how simple it is to code a program for data entry. However, it
only allows someone to enter data one time and then it quits. As we have seen in previous
sections, there are several ways to get this program to loop until we are done entering
data.
First, we can make this a command-driven program. Figure 3-4 illustrates this. If the user
enters the command REPEAT ADD instead of just ADD, the program will execute lines 3-5
forever. Just as the special key ] is used to stop processing in character mode, so the
function key [[ F8 ]] is used to stop processing in block mode. Thus this program will
continue to execute until the user presses [[ F8 ]].
vcustomer add a customer
number [ ]
name [ ]
address [ ]
city,state [ ]
zipcode [ ]
1 system ex20,base=orders,vpls=formfile;
2 list(auto) customer;
3 get(form) vcustomer,init;
4 put customer;