Download Print this page

HP 3000 Manual page 287

Mpe/ix computer systems, rpg/xl utilities
Hide thumbs Also See for 3000:

Advertisement

chapter 3 for more details). Once this process is complete, you can begin constructing the RPG program.
FORM21
For this example, begin with FORM21 by setting the correct form attributes. Enable command keys 1, 2,
3, and 7 (A, B, C, and G) by placing a character in the space identified by the correct letter. The keys
correspond to the three options available to the user (adding, deleting, or updating). Command key 7 is
used to exit the program. Indicator 60 is used for override fields.
The visual design of FORM21 is achieved by typing screen constants (labels or directions) and creating
three fields for the social security number, as shown in Figure 4-2. These fields are designated as numeric
input fields and do not have to be output fields because they are only used to read the social security
number. The three fields are inverse video fields. The RPG program reads these three fields as one.
Create a fourth field under the social security number fields to display any error messages. This is an
output field conditioned by indicator 60 with the blink field attribute turned on. The field is only used to
display a message to the user, not to return data to your program. The inverse video attribute is turned off,
and the length of the field is the length of the message that is displayed. The message identification
numbers are given in the program as constant values. The form title field on the first line is also a
message type field; this one has the message identification (000301) coded on the form instead of the RPG
program.
A fifth field, placed in the upper left corner of the form, is one character long. This field is a protected field
of constant type, with its contents hidden from the user by the security video attribute. This field is
specified as both input and output. The constant 1 is stored in the field and is used to identify the data
from this form by the RPG program.
FORM22
The form attributes for FORM22 do not have to be changed because the form uses all default values.
The social security number fields are output fields, because they are used to display information only and
not to return the information to your program. The inverse video attribute for these fields is off.
The NAME, ADDRESS, ZIP CODE, and PHONE NO. fields are input and output fields. These fields can
return data to your program after an add or an update operation, or can display data to the screen for the
user to modify. All fields are inverse video fields. The NAME and ADDRESS fields are specified as
alphanumeric, and the ZIP CODE and PHONE NO. fields are numeric. The NAME, ADDRESS, and ZIP
CODE fields are also specified as no-adjust and no-fill by leaving the adjust fill attribute blank; this causes
the data in those fields to be left-justified.
FORM22 also has a one-character protected field of constant type in the upper left corner. The security
video attribute is turned on. This field is both input and output and stores the value 2. The field is also
used to identify data from this form by the RPG program.
Constructing the RPG Program
This section describes the relationship between SIGEDITOR and RPG. Although this section is not
intended to be a detailed description of the sample program, it may be helpful to refer back to Figure 4-1 as
you read this section. See the RPG Reference Manual for detailed information about RPG programming.
SIGEDITOR can generate most of the RPG specifications required to define the work station (RSI) file and
its input/output records. These specifications can be included in your RPG program, with only minor
editing. Figure 4-4 shows the specifications generated from FORM21 and FORM22. The sample program
was constructed using these specifications. The forms filename, SAMPLIB, is specified on the "KFORMS"
file continuation record. SIGEDITOR creates this specification for you. If that specification has been
omitted, the forms filename would default to the program name (specified on the "H" specification or with
5- 289

Advertisement

loading