Using VPLUS: An Introduction to Forms Design (32209-90004)

4-7
Pattern Check. Another edit statement checks an entered value against a
pattern, which indicates the
type
of character that can be entered as
well as the exact character. The key word MATCH indicates that the value
is to be matched against the pattern. For example, you can specify that
a value start with any uppercase letter followed by three digits, a
hyphen, and two more digits with the following pattern:
MATCH uddd-dd Allows A123-56 or C009-10 and so forth.
A description of the special characters allowed in a MATCH statement
will
be presented later in this section.
Check Digit. In addition to the field edits discussed so far, there is
one other edit--you can test a value for a check digit.
Action
Refer to Section 4 and Appendix D of the
VPLUS/V Reference Manual
for a
complete discussion of what check digits are and how to add and test
them.
In this section, you add edit statements to the fields shown in Table 4-2
below.
Table 4-2. Edit Statements Added to ORDER Form
---------------------------------------------------------------------------------------------
|| | |
| Field Name | Edit Statement | Meaning |
| | |
|| | |
| ORDATE | EQ $TODAY | Date must be today's date. |
|| | |
| ST | IN $STATE | Use legal state code only. |
|| | |
| ZIP | MATCH ddddd[-dddd] | Value must match format exactly, for |
| | | example: (408) 249-7020. |
|| | |
| QTY | GE 1 | Value must be greater than or equal to |
|| |1. |
|| | |
| PARTNUM | MATCH Puddd-??? | Value must match format exactly, for |
| | | example: PA123-a57. |
|| | |
----------------------------------------------------------------------
In order to help you become familiar with the use of NEXT and PREV, you
are to specify the edit statements according to the type of edit, not in
the order of the fields on the form.