HP 3000 Manuals

FORMATTING STATEMENTS [ 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

FORMATTING STATEMENTS 

On the other hand, the two numeric values entered by the user in the
TOTNET and SHIP fields are not formatted.  You can, however, use
formatting statements to align these entered values with the calculated
dollar value in other fields.  Specifically, to format the values of the
TOTNET and SHIP fields in the TOTALS form, use the data formatting
statements STRIP and JUSTIFY.

Action 

Locate the Field Menu for SHIP in the TOTALS form.  Specify the
formatting statements, as shown in Figure 5-17.  Press ENTER. Next,
locate the TOTNET field in the TOTALS form.  Give this field the same
processing specifications.  Press ENTER. Finally, for the sake of
consistency, return to the ORDER form and format the UPRICE field in the
same way as the SHIP and TOTNET fields on the TOTALS form.  Press ENTER.

With these changes, all the dollar fields in both forms are formatted in
the same way.  Table 5-3 lists the field specifications for the ORDER
form; Table 5-4 lists the field specifications for the TOTALS form.

Note that there is no way to provide a decimal point automatically for
NUM[n] type fields, as is done with IMPn type fields.  If a decimal point
is not entered by the user, ENTRY assumes that a decimal point should
follow the last digit, but does not provide the decimal point or any
fractional values.

In addition to STRIP and JUSTIFY (illustrated above), FORMSPEC provides
two other formatting statements:  FILL and UPSHIFT. The FILL statement
replaces any leading or trailing blanks in a field with any printing
character you choose.  The UPSHIFT statements shifts all lowercase
letters to uppercase.

Action 

Press MAIN/RESUME to return to the Main Menu.  Select X to compile the
forms file and press ENTER. Press EXIT when done.

FORMSPEC compiles the new forms into the forms file ORDFORM1.  Until it
is compiled, none of the changes will be effective when used with ENTRY.

          Table 5-3.  Summary of Current Fields in the ORDER Form 

------------------------------------------------------------------------------------------------------
|                              |          |          |                                 |             |
|            Field             |          |          |                                 |             |
|                              |          |          |                                 |             |
------------------------------------------------------------------------------------------------------
|          |                   |          |          |                                 |             |
| Num      | Name              | FType    | DType    | Processing                      | Initial     |
|          |                   |          |          | Specifications                  | Value       |
|          |                   |          |          |                                 |             |
------------------------------------------------------------------------------------------------------
|          |                   |          |          |                                 |             |
|  8       | ORDNUM            | R        | CHAR     | --                              | 100000      |
|          |                   |          |          |                                 |             |
|  1       | ORDATE            | D        | MDY      | SET ORDATE TO $TODAY            | --          |
|          |                   |          |          |                                 |             |
|  2       | NAME              | O        | CHAR     | --                              | --          |
|          |                   |          |          |                                 |             |
|  3       | ADDRESS           | O        | CHAR     | --                              | --          |
|          |                   |          |          |                                 |             |
|  4       | CITY              | O        | CHAR     | --                              | --          |
|          |                   |          |          |                                 |             |
|  5       | ST                | O        | CHAR     | IN $STATE                       | --          |
|          |                   |          |          |                                 |             |
|  6       | ZIP               | O        | CHAR     | MATCH ddddd[-dddd]              | --          |
|          |                   |          |          |                                 |             |
|  7       | PHONE             | O        | CHAR     | MATCH [(ddd)]b*ddd-dddd         | --          |
|          |                   |          |          |                                 |             |
|  9       | QTY               | R        | DIG      | GE 1                            | --          |
|          |                   |          |          |                                 |             |
| 10       | PARTNUM           | R        | CHAR     | MATCH Puddd-???                 | --          |
|          |                   |          |          |                                 |             |
| 11       | DESCRIPTION       | O        | CHAR     | --                              | --          |
|          |                   |          |          |                                 |             |
| 12       | UPRICE            | R        | NUM2     | JUSTIFY RIGHT                   | --          |
|          |                   |          |          | STRIP LEADING "0"               |             |
|          |                   |          |          |                                 |             |
| 13       | TPRICE            | D        | NUM2     | SET TPRICE TO QTY * UPRICE      | --          |
|          |                   |          |          |                                 |             |
------------------------------------------------------------------------------------------------------

          Table 5-4.  Summary of Current Fields in the TOTALS Form 

------------------------------------------------------------------------------------------------------
|                              |          |          |                                 |             |
|            Field             |          |          |                                 |             |
|                              |          |          |                                 |             |
------------------------------------------------------------------------------------------------------
|          |                   |          |          |                                 |             |
| Num      | Name              | FType    | DType    | Processing                      | Initial     |
|          |                   |          |          | Specifications                  | Value       |
|          |                   |          |          |                                 |             |
------------------------------------------------------------------------------------------------------
|          |                   |          |          |                                 |             |
|  1       | ORDNUM            | R        | CHAR     | --                              | 100000      |
|          |                   |          |          |                                 |             |
|  2       | ORDATE            | D        | MDY      | SET ORDATE TO $TODAY            | --          |
|          |                   |          |          |                                 |             |
|  3       | TOTNET            | R        | NUM2     | JUSTIFY RIGHT                   | --          |
|          |                   |          |          | STRIP LEADING "0"               |             |
|          |                   |          |          |                                 |             |
|  4       | DISCNT_PERCNT     | O        | NUM0     | --                              | 10          |
|          |                   |          |          |                                 |             |
|  5       | DISCNT            | D        | NUM2     | IF TOTNET GE 1000 THEN          | --          |
|          |                   |          |          |   SET DISCNT TO                 |             |
|          |                   |          |          |   DISCNT_PERCNT % TOTNET        |             |
|          |                   |          |          | ELSE SET DISCNT TO 0            |             |
|          |                   |          |          |                                 |             |
|  6       | SUB               | D        | NUM2     | SET SUB TO TOTNET - DISCNT      | --          |
|          |                   |          |          |                                 |             |
|  7       | TAX_RATE          | R        | NUM2     | --                              | 6.25        |
|          |                   |          |          |                                 |             |
|  8       | TAX               | D        | NUM2     | SET TAX TO TAX_RATE % SUB       | --          |
|          |                   |          |          |                                 |             |
|  9       | SHIP              | O        | NUM2     | JUSTIFY RIGHT                   | .00         |
|          |                   |          |          | STRIP LEADING"0"                |             |
|          |                   |          |          |                                 |             |
| 10       | TOTAL             | D        | NUM2     | SET TOTAL TO SUB + TAX +        | --          |
|          |                   |          |          | SHIP                            |             |
|          |                   |          |          |                                 |             |
| 11       | NAME              | O        | CHAR     | --                              | --          |
|          |                   |          |          |                                 |             |
------------------------------------------------------------------------------------------------------

__________________________________________________________________________
|                                                                        |
|     :RUN ENTRY.PUB.SYS                                                 |
|                                                                        |
|     HP32209v.uu.ff ENTRY (C) HEWLETT-PACKARD CO. 1986                  |
|                                                                        |
|      ENTER FORMS FILE NAME AND PRESS RETURN: ORDFORM1                  |
|      ENTER BATCH FILE NAME AND PRESS RETURN: DATA5                     |
__________________________________________________________________________

[]
Figure 5-18. Run ENTRY; Record No. 1


MPE/iX 5.0 Documentation