HP 3000 Manuals

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


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

VGETFIELDINFO 

Returns information about specified fields to an application.

Syntax 

     VGETFIELDINFO {comarea,infobuf,infobuflen}

Parameters 

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

                 cstatus          Set to zero.

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

                 VGETFIELDINFO may set the following comarea item:

                 cstatus          Set to nonzero value if call
                                  unsuccessful.

infobuf          A record through which you pass the request for field
                 information and to which the intrinsic returns the
                 specified information.  This parameter must be
                 initialized to spaces before filling in your request and
                 calling VGETFIELDINFO. The layout of infobuf is shown in
                 Table 6-10.  The three required fields of infobuf pass
                 user-supplied parameters to VGETFIELDINFO as follows:

                 numofentries     Specifies how many fields you want
                                  information about.

                 entrylength      Indicates how many two-byte words of
                                  information (maximum 17 as shown in
                                  Table 6-10) you want about each field.

                 formname         The name of the form that contains the
                                  fields you are inquiring about.

                 The rest of infobuf (beginning with position 11) must
                 consist of entrylength number of words for each field
                 you want information about.  Thus, the total length of
                 infobufin words must be as follows:

                      10 + (entrylength * numofentries)

                 You may pass one or more of the three permissible keys,
                 which must be passed in the position indicated in the
                 table.  Remember that infobuf must be initialized to
                 spaces before filling in the parameters and any key.

infobuflen       Two-byte integer variable set to the number of two-byte
                 words in infobuf.

Discussion 

This intrinsic accesses an internal table and places information about
one or more fields into infobuf.  You tell VGETFIELDINFO how many fields,
how much information about each field, and the name of the form
containing the fields.

          Table 6-10.  Field Information Buffer 

------------------------------------------------------------------------------------------
|                                                                                        |
|       Data Type         Position           Contents                  Comments          |
|                                                                                        |
------------------------------------------------------------------------------------------
|                                                                                        |
| Integer               1            numofentries              Required                  |
|                                                                                        |
|                                                                                        |
|                                                                                        |
| (Two-byte)            2            entrylength               Required                  |
|                                                                                        |
------------------------------------------------------------------------------------------
|                                                                                        |
| Character Array       3-10         formname                  Required; second byte of  |
| (16-byte)                                                    position 10 is unused     |
|                                                                                        |
|                                                                                        |
|                                                                                        |
|                       11-18        Field name                Permissible key; last     |
|                                                              byte of position 18 is    |
|                                                              unused                    |
|                                                                                        |
------------------------------------------------------------------------------------------
|                                                                                        |
| Integer               19           Field number according to Permissible key           |
|                                    screen order.                                       |
|                                                                                        |
|                                                                                        |
|                                                                                        |
| (Two-byte)            20           Field number              Permissible key; in order |
|                                                              of creation               |
|                                                                                        |
|                                                                                        |
|                                                                                        |
|                       21           Field length              In bytes                  |
|                                                                                        |
|                                                                                        |
|                                                                                        |
|                       22           Position of field in data In bytes, offset from     |
|                                    buffer                    zero                      |
|                                                                                        |
------------------------------------------------------------------------------------------
|                                                                                        |
| Character Array       23-24        Field enhancement         Combination of I, H, U,   |
| (4-byte)                                                     B, 1-8, or NONE.          |
|                                                                                        |
|                                                                                        |
|                                                                                        |
|                       25-26        Data type of field        May be CHAR, DIG, IMPn,   |
|                                                              date (MDY, DMY, YMD), or  |
|                                                              NUM[n].                   |
|                                                                                        |
------------------------------------------------------------------------------------------
|                                                                                        |
| Character             27           Field type                First byte of position    |
| (Two-byte)                                                   27; may be O, R, P or D.  |
|                                                                                        |
------------------------------------------------------------------------------------------

Passing INFOBUF Without Entering Keys 

Keys are optional.  If you do not supply a key to indicate the first
field you want information about, VGETFIELDINFO starts with the first
field not already reported on by the current call.

As an example, suppose you want information about 10 fields, and you
enter screen order numbers 3, 5, and 6 as keys.  VGETFIELDINFO returns
information about fields 3, 5, 6, and 7 through 13.  If you enter no
keys, VGETFIELDINFO returns information about fields 1 through 10.

Table Wraparound 

VGETFIELDINFO starts over with the first field in the form if you request
information about more fields than are in the form or, if when you pass a
key, your request goes beyond the end of the form.

Suppose a form has 12 fields.  If you request information about 10 of the
fields and enter screen order number 8 as a key, VGETFIELDINFO returns
information about fields 8 through 12, and then goes to the beginning of
the form and returns information about fields 1 through 5.

Example 

COBOL

     DATA DIVISION.
            :
            :
     WORKING-STORAGE SECTION.
     01 INFOBUF.
         05    NUMBER-OF-ENTRIES                           PIC S9(4) COMP.
         05    ENTRY-LENGTH                                PIC S9(4) COMP.
         05    FORM-NAME                                   PIC X(15).
         05    FILLER                                      PIC X.
         05    ENTRY-TABLE OCCURS 10 TIMES.
               10  FIELD-NAME                              PIC X(15).
               10 FILLER                                   PIC X.
               10  SCREEN-ORD-NUM                          PIC S9(4) COMP.
               10  FIELD-NUM                               PIC S9(4) COMP.
               10  FIELD-LENGTH                            PIC S9(4) COMP.
               10  FIELD-POSITION                          PIC S9(4) COMP.
               10 FIELD-ENHANCE                            PIC X(4).
     01 INFOBUFLEN                                         PIC S9(4) COMP VALUE 80.
            :
            :
     PROCEDURE DIVISION.
            :
            :
         MOVE SPACES TO INFOBUF.
            :
         MOVE 5 TO NUMBER-OF-ENTRIES.
         MOVE 14 TO ENTRY-LENGTH.
         MOVE "FORM1                " TO FORM-NAME.
         MOVE 2 TO SCREEN-ORD-NUM.
         CALL "VGETFIELDINFO" USING COMAREA, INFOBUF, INFOBUFLEN.

The example shown above illustrates the data declaration of infobuf and
infobuflen and the passing of parameters to VGETFIELDINFO. Note that
before the intrinsic is called, infobuf is initialized to spaces (not 
zeros).  The intrinsic copies 14 two-byte words of information about
fields 2 through 6 of form FORM 1 into infobuf.



MPE/iX 5.0 Documentation