Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Nanforum Toolkit v2.1 Reference Guide - <b>ft_isbit()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 FT_ISBIT()
 Test the status of an individual bit
------------------------------------------------------------------------------

 Syntax

      FT_ISBIT( <cByte>, <nBitPos> ) -> lResult

 Arguments

     <cByte> is a character from CHR(0) to CHR(255)

     <nBitPos> is a number from 0 to 7 conforming to standard right-to-left
               bit-numbering convention and representing the position of the
               bit within the byte.

 Returns

     .T. if designated bit is set (1), .F. if not set (0), NIL if
      invalid parameters.

 Description

     Tests for status of any selected bit in the byte passed as a parameter.
     Byte must be presented in CHR() form, as a literal constant, or as the
     one-byte character result of an expression.

     This function is presented to illustrate that bit-wise operations
     are possible with Clipper code.  For greater speed, write .C or
     .ASM versions and use the Clipper Extend system.

 Examples

     This code tests whether bit 3 is set in the byte represented by
     CHR(107):

      lBitflag := FT_ISBIT(CHR(107), 3)
      ? lBitflag                  // result: .T.

      This code tests whether bit 5 is set in the byte represented by ASCII
      65 (letter 'A')

      ? FT_ISBIT('A', 5)          // result: .F.

     For a demonstration of Clipper bit manipulations, compile and
     link the program BITTEST.PRG in the Nanforum Toolkit source code.

 Source: ISBIT.PRG

 Author: Forest Belt, Computer Diagnostic Services, Inc.

See Also: FT_BITSET() FT_BITCLR()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson