DTRHELP.HLB  —  Functions  FN$BIT_EXTRACT
       Returns the bit field within a longword.

1  –  Input

       This function takes three parameters: the longword, the starting
       bit in the longword, and the length of the bit field in the
       longword. The three must be separated by a comma and enclosed
       in parentheses.

2  –  Output

       An integer number.

3  –  Example

       DTR> DECLARE SOURCE PIC 99999999 LONG .;
       DTR> DECLARE I LONG .;
       DTR> SOURCE = 7 ;
       DTR> I = 0;
       DTR> REPEAT 6
       CON>    BEGIN
       CON>    PRINT FN$BIT_EXTRACT(SOURCE,I,1);
       CON>    I = I+1;
       CON>    END

         FN$BIT
         EXTRACT

                 1
          1
          1
          0
          0
          0
       DTR>
Close Help