HP 3000 Manuals

VFIELDEDITS [ HP Data Entry and Forms Management System (VPLUS/V) ] MPE/iX 5.0 Documentation


HP Data Entry and Forms Management System (VPLUS/V)

VFIELDEDITS 

Edits data entered in each field of form and, if indicated, modifies data
in the data buffer.  If necessary, sets error flags.

Syntax 

     VFIELDEDITS {comarea}

Parameters 

comarea          Must be comarea name specified when forms file was
                 opened with VOPENFORMF. If not set already, the
                 following comarea items must be set before calling
                 VFIELDEDITS:

                 cstatus          Set to zero.

                 comarealen       Set to total number of two-byte words
                                  in comarea.

                 VFIELDEDITS may set the following comarea items:

                 numerrs          Set to total number of fields in which
                                  errors were detected.

                 cstatus          Set to nonzero value if call
                                  unsuccessful.

                 nfname           Set to new next form name if name
                                  changed by processing specifications.

                 repeatapp        Set to new current form code if code
                                  changed by processing specifications.

                 freezapp         Set to new next form code if code
                                  changed by processing specifications.

Discussion 

This intrinsic checks the data content of each field.  It checks that the
data type and field type are correct, and if any special processing
specifications were defined for this field in the Field Edit phase, it
checks that the data conforms to these specifications.  If any data
formatting or data movement was specified for a field, VFIELDEDITS
performs these functions on the data in the data buffer.

For each field that does not pass the edit checks, VFIELDEDITS sets an
error flag.  These error flags are used by the VPLUS/V intrinsics, as
shown in Table 6-9.  In addition, these error flags can be accessed by an
application with a call to VGETFORMINFO, which retrieves a table
corresponding to the current error flag settings.

          Table 6-9.  Actions Used by Intrinsics 

--------------------------------------------------------------------------------------------
|                           |                                                              |
|         Intrinsic         |                            Action                            |
|                           |                                                              |
--------------------------------------------------------------------------------------------
|                           |                                                              |
| VGETNEXTFORM              | Initializes all the error flags to zero.                     |
|                           |                                                              |
--------------------------------------------------------------------------------------------
|                           |                                                              |
| VFIELDEDITS               | Each may set field error flags on, increment numerrs, and    |
| VFINISHFORM               | set an internal error number used by VERRMSG.                |
| VINITFORM                 |                                                              |
| VSETERROR                 |                                                              |
|                           |                                                              |
--------------------------------------------------------------------------------------------
|                           |                                                              |
| VSHOWFORM                 | Enhances the fields whose error flags are set.               |
|                           |                                                              |
--------------------------------------------------------------------------------------------
|                           |                                                              |
| VREADFIELDS               | Resets the flags to zero after the form is displayed.        |
|                           |                                                              |
--------------------------------------------------------------------------------------------
|                           |                                                              |
| VPUTBUFFER                | Each may clear field error flags and decrement numerrs if    |
| VPUTFIELD                 | new data is entered into a field with an error.              |
| VPUTtype                  |                                                              |
|                           |                                                              |
--------------------------------------------------------------------------------------------

After setting error flags for all fields with errors, VFIELDEDITS saves
the error number of the first field with an error.  (Fields are counted
in screen order, starting at the top left and moving left to right, then
top to bottom.)  VFIELDEDITS sets numerrs to the total number of fields
in which errors were found.

If requested by a call to VERRMSG, the text associated with the error
number in the VPLUS/V error message file, or the associated custom error
message, is returned to an application.  If requested by a call to
VPUTWINDOW, the message is copied to the window area of memory.  Then, a
call to VSHOWFORM can be used to display this message on the terminal
screen and enhance the fields with errors.

Example 

COBOL

     CALL "VFIELDEDITS" USING COMAREA.

BASIC

     150 CALL VFIELDEDITS(C(*))

FORTRAN

     CALL VFIELDEDITS(COMAREA)

SPL/PASCAL

     VFIELDEDITS(COMAREA);



MPE/iX 5.0 Documentation