HP 3000 Manuals

Data Transfer Method D [ High-Level Screen Management Intrinsic Library (Hi-Li) Reference Manual ] MPE/iX 5.0 Documentation


High-Level Screen Management Intrinsic Library (Hi-Li) Reference Manual

Data Transfer Method D 

This data transfer method lets you move data to and from the fields
referenced in the form, but the application buffer does not have to match
the screen layout.  All data must come from one buffer.  This method also
allows your application to specify data type conversions.  It has all the
power and and usage of method F (that uses an ARB), but has the advantage
of letting your application resolve data buffer formats and layout at
run-time.  Use this transfer method when the application data buffer does
not correspond to the form buffer and your application has special
run-time requirements.

You indicate this kind of data transfer by assigning the value 40 or 50
to the subparameter descrpttype.  Assign the value 40 if you want to
identify fields by number.  Assign the value 50 if you want to identify
fields by name.

The subparameters you must supply to use this data mapping method and
their values are:

descrpttype               Supply the value 40 to identify fields by
                          number.

                          Supply the value 50 to identify fields by name.

buflen                    A four-byte integer.  This subparameter is not
                          used by Hi-Li for this method, but must be
                          passed anyway.

rtnbuflen                 A four-byte integer.  This subparameter is not
                          used by Hi-Li for this method, but must be
                          passed anyway.

entrycnt                  Supply a four-byte integer to indicate the
                          number of active field entries in the table.

fldentry                  Identifies the table in your application.

fldloc                    Supply a four-byte integer to indicate the byte
                          offset of the field with respect to the databuf 
                          parameter.  The offset is 1 relative.  If you
                          supply a zero, the offset of the referenced
                          field in the form is used by default.  You
                          cannot supply a negative offset.

fldlen                    Supply a four-byte integer to indicate the
                          number of bytes you want to move.  If you
                          supply a zero, the length of the referenced
                          field in the form data buffer is used by
                          default.  If you supply a negative value, no
                          data is moved between the application and the
                          form.

rtnfldlen                 A four-byte integer.  The number of field data
                          bytes actually moved is returned here.

typcnvcode                Supply a four-byte integer to indicate the data
                          type conversion you want performed.  The data
                          type conversion codes are:

                          0 = no conversion
                          1 = two-byte integer conversion
                          2 = four-byte integer conversion
                          3 = four-byte HP3000 format floating point
                          (real) conversion
                          4 = eight-byte HP3000 format floating point
                          (long) conversion
                          5 = reserved for four-byte IEEE format floating
                          point (real) conversion
                          6 = reserved for eight-byte IEEE format
                          floating point (long) conversion

fldid                     If you have given descrpttype a value of 40,
                          supply a four-byte integer that identifies a
                          field.  An integer greater than zero indicates
                          a field number; an integer less than zero
                          indicates screen order.

                          If you have given descrpttype a value of 50,
                          supply a 32-byte character array that
                          represents the USASCII name of the field.

Examples 

        COBOL:
                    01  datadescrpt.
                        05  descrptype         pic s9(8) comp.
                        05  buflen             pic s9(8) comp.
                        05  rtnbuflen          pic s9(8) comp.
                        05  entrycnt           pic s9(8) comp.
                        05  fldentry       occurs 5 times.
                            10  fldloc         pic s9(8) comp.
                            10  fldlen         pic s9(8) comp.
                            10  rtnfldlen      pic s9(8) comp.
                            10  typcnvcode     pic s9(8) comp.
                            10  fldid          pic x(32).

        FORTRAN:
                    INTEGER*4     DATADESCRPT(64)
                    INTEGER*4     DESCRPTTYPE
                    INTEGER*4     BUFLEN
                    INTEGER*4     RTNBUFLEN
                    INTEGER*4     ENTRYCNT
                    EQUIVALENCE (DATADESCRPT(1), DESCRPTTYPE(,
                   +            (DATADESCRPT(2), BUFLEN),
                   +            (DATADESCRPT(3), RTNBUFLEN),
                   +            (DATADESCRPT(4), ENTRYCNT)
                         INTEGER*4     FLDLOC(12,5)
                         INTEGER*4     FLDLEN(12,5)
                         INTEGER*4     RTNFLDLEN(12,5)
                         INTEGER*4     TYPCNVCODE(12,5)
                         EQUIVALENCE (DATADESCRPT(5), FLDLOC),
                        +            (DATADESCRPT(5), FLDLEN),
                        +            (DATADESCRPT(5), RTNFLDLEN),
                        +            (DATADESCRPT(5), TYPCNVCODE)
                         CHARACTER*16  FLDID(3,5)
         EQUIVALENCE (DATADESCRPT(5), FLDID)

For an example of how a record structure can be manipulated in FORTRAN,
see the COLLECT_TXNS subroutine in the FORTRAN example program in
Appendix C.

        Pascal:
                    type
                      fldentry_rec = record
                        fldloc          : integer;
                        fldlen          : integer;
                        rtnfldlen       : integer;
                        typcnvcode      : integer;
                        fldid           : packed array [1..32] of char;
                          end;

                    datadescrpt_rec = record
                      descrpttype     : integer;
                      buflen          : integer;
                      rtnbuflen       : integer;
                      entrycnt        : integer;
                      fldentry        : array [1..5] of fldentry_rec;
                        end;

                    var
                      datadescrpt       : datadescrpt_rec;



MPE/iX 5.0 Documentation