HP Data Entry and Forms Management System (VPLUS) Reference Manual (32209-90024)

652 AppendixL
A Programmer’s Guide to VPLUS
VPLUS Intrinsic Calls
[COBOL programmers must add 2 to SHOWCONTROL]
VSHOWFORM (COMAREA)
SHOWCONTROL (14:1)=0
[COBOL programmers must subtract 2 from SHOWCONTROL]
Lastly, VGETNEXTFORM may be called with $RETURN. Before performing VGETNEXTFORM,
REPEATAPP must be 0 as in all the above cases. VPLUS keeps track of the forms most
recently used by your program. $RETURN returns the last form called. If the current form is
$HEAD, it returns $HEAD again (no forms file access is actually done). The form file
definition which is retrieved by VGETNEXTFORM is stored in an area of the user’s stack called
the comarea extension.
VINITFORM
Purpose: to initialize fields on the current form.
VINITFORM is called after VGETNEXTFORM in order to initialize any fields on a form. For
example, on the field menu, the designer may specify an initial value. Or within the field
processing section of the field menu, a designer may specify INIT phase specifications such
as setting the field to a value of another field on the form.
VINITFORM uses any initial value specified in the FIELD MENU and performs any processing
specifications defined in the INIT phase.
Any field that does not have a specified initial value is by default set to $EMPTY (all blanks).
If this is a child form, the values for any fields that do not have an initial value are
retrieved from the parent form. The only parameter passed to VINITFORM is COMAREA. The
fields within the comarea array which VINITFORM may set are listed in the VPLUS/V
Reference Manual.
Any initialized values are placed in the comarea extension’s data buffer.
VPUTBUFFER
Purpose: to place data from a program buffer into the VPLUS data area.
Before the form is displayed with the initialized fields, additional information may be
retrieved from a data base, KSAM file, MPE file, or from within the program. This is
application dependent. Once the data is retrieved with a DBGET or FREAD call, VPUTBUFFER
transfers the data from the program’s form buffer to the VPLUS data buffer. VPUTBUFFER,
however, does not format the data being sent to the data buffer (e.g., strip leading zeros or
format signs on numeric fields); this must be handled by the application before
VPUTBUFFER is called. The comarea extension contains its own copy of the data buffer
which aids VPLUS to interface with the terminal.
VPUTBUFFER is an optional step for preparing and showing the screen function. It is used if
information from other sources needs to be displayed on the screen. An example is showing
an employee’s name which is retrieved from a personnel data base after the user has
entered the employee’s number.
The call to VPUTBUFFER in pseudocode looks like:
VPUTBUFFER (COMAREA, BUFFER, BUFLEN)
There are three parameters passed to VPUTBUFFER: COMAREA, buffer, and buffer length. The