HP 3000 Manuals

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


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

Appendix I  BIT MAP CONVERSION 

BIT MAP CONVERSION 

An intrinsic called BITMAPCNV is provided to help decode and set bits in
programming languages which do not have bit operations.  It is
particularly helpful in COBOL with the bit map returned by VGETFIELDINFO.

Syntax 

              BITMAPCNV {bitmap,bytemap,numbytes,function,cnverr}

Parameters 

bitmap           Source bit array containing bits to be converted to a
                 byte array, or destination bit array for conversion from
                 a byte array.

bytemap          Destination or source byte array.  (For COBOL use
                 @BYTEMAP)

numbytes         Two-byte integer set to number of bytes to be converted
                 from or to.

function         Two-byte integer set to conversion type;
                   1 = bit to byte,
                   2 = byte to bit

cnverr           Two-byte integer variable containing conversion error
                 return;
                   0 = conversion successful,
                   -1 = conversion failed,
                   -2 = invalid input parameter

Discussion 

This intrinsic can be used to set bits in the comarea.  It can also be
used to decode the error bit map returned by VGETFORMINFO. The BITMAPCNV
intrinsic decodes a bit map to a byte array if the function parameter
contains a value of one.  Each byte in the byte array represents the
corresponding bit in the bit map.  If a bit in the bit map is on (value
of one), the corresponding byte will contain the character of one (1).
If the bit is off, the byte will contain the character of zero (0).

If the function parameter passed contains a value of two, the conversion
will be from byte to bit.  A bit map will be produced to reflect the 1's
and 0's in a byte array.

When converting bytes to bits, anything in a byte other than the
character zero (0) causes the corresponding bit in the bit map to be set
to one (1).

In COBOL, BITMAPCNV can be called as shown in the example below.

Example 

          CALL "BITMAPCNV" USING BITMAP,@BYTEMAP,NUMBYTES,FUNCTION,CNVERR.



MPE/iX 5.0 Documentation