HP 3000 Manuals

USE PATTERN MATCHES [ USING VPLUS/V AN INTRO. TO FORMS DESIGN Self-Paced Training Guide ] MPE/iX 5.0 Documentation


USING VPLUS/V AN INTRO. TO FORMS DESIGN Self-Paced Training Guide

USE PATTERN MATCHES 

Now you should be at the Field Menu for the field, ZIP.

Action 

Press FIELD TOGGLE. Type MATCH ddddd[-dddd] in the lower menu, as shown
in Figure 4-7.  Press ENTER.

Here you use a pattern match to make sure that any entered zip code is
five digits with, optionally, four more digits with a hyphen between the
fifth and sixth digit.

[]
Figure 4-8. Field Menu for PHONE in the ORDER Form A good illustration that uses some of the pattern characters is the match pattern for a telephone number. Action Press FIELD TOGGLE. Type MATCH [(ddd)]b*ddd-dddd in the lower menu, as shown in Figure 4-8. Press ENTER. The brackets surrounding the area code allow it to be omitted. The asterisk (*) after the letter b allows zero spaces or as many as you want. Table 4-5 illustrates some other examples of pattern choices. Table 4-5. Pattern Choices -------------------------------------------------------------------------------------------- | | | | Pattern | Meaning | | | | -------------------------------------------------------------------------------------------- | | | | {A,B,!a,!b} | Required grouping - Entered character corresponding to this | | | pattern must be A, B, a, or b. | | | | | [A,B,!a,!b] | Optional grouping - No character need be specified in this | | | position or, if entered, it must be A, B, a, or b. | | | | | d+ | Required repetition - At least one digit must be entered, and as | | | many more digits as desired may be entered. | | | | | d* | Optional repetition - No digit need be entered in this position, | | | or as many digits as desired may be entered. | | | | | {A,B,!a,!b}+ | Any of the enclosed characters can each be repeated as many | | | times as desired - for example: BBBBaab. | | | | | {A,B,!a,!b}* | No character need be specified, or any of the enclosed | | | characters can be repeated. | | | | --------------------------------------------------------------------------------------------
[]
Figure 4-9. Field Menu for PARTNUM in the ORDER Form When you press ENTER at the Field Menu for PHONE, the Field Menu for QTY, which was shown earlier in Figure 4-5, is displayed on your terminal screen. Action Press NEXT to display the Field Menu for PARTNUM. A part number also provides a good example of how to use a pattern match. Action Press FIELD TOGGLE. Type MATCH Puddd-??? in the lower menu, as shown in Figure 4-9. Press ENTER. A part number such as PS123-XYZ or PC999-001 is accepted by the pattern match statement shown above, but Pa222-001 or BA123-TTT would cause an error.
[]
Figure 4-10. Field Menu for ORDATE in the ORDER Form


MPE/iX 5.0 Documentation