HP RPG/XL Programmer's Guide (30318-90001)

4-: 25
Figure 4-14 shows what the screen form (in Figure 4-13) looks like when
displayed from an RPG program. Input fields are highlighted.
The line at the bottom of the screen is the message window. It is used
to display one-line messages.
Figure 4-14. Using a VPLUS Form Within an RPG Program
The form shown in Figure 4-14 is used in examples throughout the VPLUS
sections in this chapter. The form is used to update the D-ACCOUNTS data
set (see the schema for the MARKET database in Figure 3-23.
Defining a VPLUS Form. To use a VPLUS form in an RPG program, enter a
File Description Specification for it, defining it as a WORKSTN file.
Also enter Input and Output Specifications that describe the form as well
as the action and event records that let you communicate with VPLUS. Only
define those fields on the form that you're actually using in the
program. You can get the field starting and ending locations from the
event and action record formats described in the
HP RPG Reference Manual
and the forms file listing produced by FORMSPEC.
Figure 4-15 shows how to define a VPLUS form. The form used is the one
in Figure 4-14. Notice that there are two input records for the file,
TERMINAL. The first is used for processing event code 09. (To review
events, see the section titled "Using VPLUS.") The second input record
defines the VPLUS form fields used in the program. There are three
output records. The first is used to initiate VPLUS actions other than
reading data from the screen. (To review VPLUS actions, see the section
titled "Using VPLUS.") The second output record is used for displaying
screen data and the third defines the fields in the message window (see
the section "Displaying VPLUS Messages" for information about the message
window).