The TESTOFF function tests a specified bit in a binary number item to see whether it is off.


TESTOFF ( single-binary-number-expression , single-integer-expression )

TESTOFF ( binary_number_to_test , bit_to_test )
"True" or "false"

The value of bit_to_test specifies which bit of binary_number_to_test should be tested for the value 0. If bit_to_test has the value 1, it refers to the leftmost bit of binary_number_to_test.

The TESTOFF function returns "true" if the specified bit is off and returns "false" if the specified bit is on.

If bit_to_test is less than one or greater than the number of bits of binary_number_to_test, TESTOFF returns "false".


  • TESTOFF (A, 16)

    Assume A is the two-byte binary value of "1", which is all zeros except for bit 16. The binary representation of the value in A is 0001.

    This example returns "false".

  • TESTOFF (A, 20)

    Returns "false" because bit 20 does not exist.