HP 3000 Manuals

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


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

VPUTFIELD 

Copies data from an application into a specified field in the data buffer
in memory.

Syntax 

             VPUTFIELD {comarea,fieldnum,fieldbuf,buflen,actualen,nextfldnum}

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
                 VPUTFIELD:

                 cstatus          Set to zero.

                 language         Set to the code identifying the
                                  programming language of the calling
                                  program.

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

                 VPUTFIELD may set the following comarea items:

                 cstatus          Set to nonzero value if call
                                  unsuccessful.

                 numerrs          May be decremented if new value is
                                  moved to a field which has error flag
                                  set.

fieldnum         Two-byte integer variable containing the number assigned
                 to the field in the data buffer by FORMSPEC.

fieldbuf         Character string in an application containing the data
                 to be copied to the specified data buffer field.

buflen           Two-byte integer containing the number of bytes to be
                 copied from fieldbuf to the field identified by
                 fieldnum.

actualen         Two-byte integer that specifies the number of bytes
                 actually copied.

nextfldnum       Two-byte integer to which VPUTFIELD returns the number
                 of the next field in screen order.  If there are no more
                 fields, it returns zero.

Discussion 

The data in an application is copied to the field in the data buffer
identified by its field number.  Note that the field number is a unique
number assigned to the field by FORMSPEC when the form is first created.
The number assigned to a field by FORMSPEC does not change regardless of
any changes to the field's position in the form or to its length.  The
field number can only be changed with the batch command, RENUMBER, as
described in Section 7.  The field number must not be confused with the
screen order number, which is the field's position in the data buffer and
corresponds to its position in the form.

If the field is shorter than the data transferred to it, the data is
truncated on the right.  If the field is longer than the data transferred
to it, the data, if any, in the remaining space in the field is not
changed.

If the field whose data is being replaced contained an error, VPUTFIELD
clears the field's error flag, and decrements numerrs.

Note that VPUTFIELD does not convert the data.  To convert data from
internal numeric representation to character strings, you must use
VPUTtype, where type specifies the data type of the field in an
application.

Example 

COBOL

           MOVE 1 TO FIELDNUM.
           MOVE 10 TO FIELD-LEN.
           MOVE "GADGET        "TO PART-DES.
           CALL "VPUTFIELD" USING COMAREA, FIELDNUM, PART-DES, FIELD-LEN,
                                         DESC-LEN, NEXT-FIELD.

BASIC

           250 F1=1
           255 C=10
           257 I$="GADGET   "
           260 CALL VPUTFIELD(C(*),F1,I$,C,A,N)

FORTRAN

           FLDNUM=1
           ICOUNT=10
           XITEM="GADGET          "
           CALL VPUTFIELD(COMAREA,FLDNUM,XITEM,ICOUNT,INUM,FLDNXT)

SPL/PASCAL

           INTEGER
              FLD'NUM,
              COUNT,
              ACTUAL'LEN,
              NXT'FLD'NUM;
              BYTE ARRAY PART'DES(0:9):="GADGET          ";
                 :
              FLD'NUM:=1;
              COUNT:=10;
              VPUTFIELD(COMAREA,FLD'NUM,PART'DES,COUNT,ACTUAL'LEN,NXT'FLD'NUM);

The calls shown above copy a 10-byte value from an application to field
number 1 in the data buffer.



MPE/iX 5.0 Documentation