BITTEST( ) Function

Determines whether a specific bit in a Numeric, Varbinary, or Blob value is set to 1. There is a numeric and a binary version of the syntax.


If the specified expression is not an integer, it is converted to an integer before performing the operation.

BITTEST(nNumericExpression1, nNumericExpression2)
BITTEST(BinaryExpression, nBitNumber)



Specifies the Numeric value to check for the specified bit.


Specifies the bit position in nExpression1 to check. nExpression2 can range from 0 to 31 with 0 as the bit farthest to the right.


Specifies a Varbinary or Blob expression to check for the specified bit.


Specifies a zero-based bit in qExpression.

If nBitNumber is out of range of qExpression, Visual FoxPro generates an error.

Expand imageReturn Value

Expand imageExample

Expand imageSee Also

© , 1996-2020 • Updated: 11/10/20
Comment or report problem with topic