Data Transformation Engine Functions and Expressions Reference Guide
Chapter 3 - Function Reference TESTOFF
Functions and Expressions Reference Guide
197
TESTOFF
The TESTOFF function tests a specified bit in a binary number to see whether it is
off.
Syntax
TESTOFF ( single-binary-number-expression ,
single-integer-expression )
Meaning
TESTOFF ( binary_number_to_test , bit_to_test )
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.
Returns
This function returns TRUE or FALSE
Returns TRUE if the specified bit is off. 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.
Examples
Assume A is the two byte binary value 1 (which is all zeros except for bit 16).
The binary representation of the value in A is: 0001.
TESTOFF (A, 16)
Returns FALSE.
TESTOFF (A, 20)
Returns FALSE because bit 20 does not exist.
Uses
Use
TESTOFF to test whether a specified bit is off in a binary number item.
Related Functions
SETOFF, SETON, TESTON