DESIGNING YOUR FORMS FILE [ HP Data Entry and Forms Management System (VPLUS/V) ] MPE/iX 5.0 Documentation
HP Data Entry and Forms Management System (VPLUS/V)
DESIGNING YOUR FORMS FILE
The following hints may help you design your forms file with FORMSPEC:
1. If the status/window line is the last line on the screen, it
should be no longer than 79 characters. This is because using the
80th character on the bottom line of the screen causes the screen
to roll up one line temporarily. If this roll-up is not a
problem, then the last line can use 80 characters.
2. On an HP 264X terminal, when a form is to be appended, column 80
of any line of the form with an unprotected field should not be
used. When the next form is displayed, column 80 of the current
form disappears.
3. If you want to enhance text (the protected area of the screen),
you can define a field with a display only field type and any
enhancements you desire. Using the INIT processing phase
specification, text can be initialized to appear in the field.
For example:
This method can also be used to alter "text" on the screen during
execution. Define a display only field with the desired
enhancements. You can either use the processing specifications
phases (INIT, FIELD or FINISH) to alter the contents of the field
or you can programmatically change the field contents using
VPUTBUFFER or VPUTFIELD intrinsic calls.
_________________________________________________________________
NOTE Processing specifications only execute if the application
calls the "editing" intrinsics: VINITFORM, VFIELDEDITS,
VFINISHFORM.
_________________________________________________________________
4. If you want to define blank lines at the bottom of a form, define
a display only field of at least one character at the end of the
blank lines. Delimit the field by ESCAPE [ and ESCAPE ], with the
field enhancements of NONE. This forces the display of seemingly
blank lines and does not affect the application programs.
Otherwise FORMSPEC would delete trailing blank lines from a form.
5. If you use save fields to accumulate totals and you expect the
user to browse and correct the fields used for summation, special
care must be taken to ensure that the totals are accurate. If an
entered value is summed into a save field, and then this value is
changed in browse/modify mode, the new value is also summed into
the save field unless you specify the SET statement to account for
this possibility.
For example, assume you are accumulating values entered in a field
F1 into a save field used for batch totals BT. In order to allow
only the correct values to be accumulated, construct a
display-only field OLDF1 identical in its characteristics to F1.
The field is initialized to zero in collect mode only, but not in
browse mode. In browse mode, OLDF1 contains the previous value of
F1. This previous value is then subtracted from the sum BT. The
following specifications are entered in the F1 Field Menu to
ensure that only the correct values are summed:
INIT
SET OLDF1 TO 0 \executed only in collect mode
FIELD
<any edit statements>
SET BT TO BT + F1 - OLDF1 \executed in browse or collect
mode
SET OLDF1
6. If you want to include a logical AND function in your processing
specifications, use nested IF statements. For example, to get the
effect of
IF A=B AND C=D AND E=F
use the following statements:
IF A=B THEN
IF C=D THEN
IF E=F THEN
To negate an IF condition, simply use the ELSE part with a null
THEN part.
A logical OR or NOR cannot be similarly specified, but for
comparisons on a single field, use IN or NIN with a list. For
example, to get the effect of
IF A=B OR A=D OR A=F
use the edit statement:
A IN B, D, F
7. Sometimes in data entry applications, the user would like to
knowingly enter a value that normally falls the designer's edits.
This is called "Edit Override", and can be implemented through
FORMSPEC in a number of ways.
a. Adopt a user convention to require some special character(s)
in the field along with the desired data. (Note that the
field must be made long enough to accommodate the extra
character(s).) For example:
IF MATCH ?*!! THEN \Skip the edits.
ELSE<edit statements> \No trailing "!"; apply normal edits
Note that the special characters must satisfy the default data
type edit. The above statement, for instance, would not work
with a numeric field. Some possibilities of special
characters for numeric fields are leading zeros (MATCH O?*), a
leading plus (MATCH !+?*), or a comma (MATCH 000,?*). If
signed numbers are expected, prefix your pattern with !+,-.
b. Include an auxiliary EDIT OVERRIDE field that must be marked
in order to bypass edits. For example, assume a field named
EO:
IF EO MINLEN 1 THEN
ELSE<edit statements> \EO not marked; apply edits
8. The contributed utility program RESTORE will not correctly copy
records larger than 2000 bytes. If you wish to copy a KSAM forms
file or reformat file from a store tape to a disc file, use the
MPE :RESTORE command and the FCOPY subsystem.
9. There are three file equations for which VPLUS/V checks during
execution. The use of these file equations provides the user with
a way to override the defaults used by VPLUS/V. These file
equations are also useful when attempting to debug an application
with trace messages or when DEBUG is used. The VPLUS/V intrinsic
VOPENTERM, used by FORMSPEC, ENTRY, and REFSPEC, searches for a
file equation named A264X. VOPENTERM attempts to open the device
referenced by A264X to display VPLUS/V forms and accept their
associated input. For example:
:FILE A264X; DEV=28
:RUN ENTRY.PUB.SYS
causes logical device 28 to be opened by VOPENTERM, and subsequent
screen displays by VSHOWFORM appear on LDEV 28. In this example,
LDEV 28 must be a logged off terminal in an available state.
Applications can make use of this feature by using the termfile
parameter of VOPENTERM and a file equation. If the second
parameter to VOPENTERM contained the value TERMINAL, the following
file equation will cause logical device 28 to be opened for forms
display:
:FILE TERMINAL;DEV=28
Trace and abort messages will be displayed to the command
terminal--the one which initiated the application. This would be
the main reason to use this feature as abort messages are
frequently impossible to read because they are displayed in the
unprotected fields of a VPLUS/V application.
The second file equation which VPLUS/V searches for is FORMLIST.
The VPRINTFORM intrinsic uses FORMLIST to list forms (as in
ENTRY). FORMLIST defaults to the system printer. If, however, the
user wishes to save the list file on disc, the following file
equation does just that, creating a file named FORMLIST containing
the form listing.
:FILE FORMLIST; DEV=DISC;SAVE
If your system has both a page printer and a line printer
(default), the file equation:
:FILE FORMLIST;DEV=PP
sends the form listing to the page printer.
The third file equation which VPLUS/V uses deals with a summary
listing of the forms file from batch mode FORMSPEC. Batch mode
prints to a file named FORMOUT. A file equation for FORMOUT can
use the same parameters as discussed for the file FORMLIST.
10. The LIST command and the batch mode FORMS command print a
maximum of 60 lines per page. This maximum may be altered by
setting the JCW.
FORMSPECLINESPERPAGE
For example, the MPE command
:SETJCW FORMSPECLINESPERPAGE=45
sets the maximum number of lines per page to 45. This JCW is
useful when more white space is desired at the bottom of the page,
or when special paper is used.
FORMSPECLINESPERPAGE must be in the range 1 to 150. Any value
outside this range will cause a LIST command to fail, and will
cause batch mode FORMSPEC to halt with the error message.
FORMSPECLINESPERPAGE must be between 1 and 150
No lines will be printed in either case, to ensure that FORMSPEC
does not waste paper printing a listing of FORMS reference in an
unwanted format.
MPE/iX 5.0 Documentation