Click or drag to resize

BitNot Function (Binary, Long, Long)

X#
Performs a bitwise NOT operation on a value of Numeric, Varbinary, or Blob type and returns the bitwise complement on the specified value. 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.

Namespace:  XSharp.VFP
Assembly:  XSharp.VFP (in XSharp.VFP.dll) Version: 2.21
Syntax
 FUNCTION BitNot(
	BinString AS BINARY,
	StartBit AS LONG,
	 BitCount AS LONG
) AS BINARY
Request Example View Source

Parameters

BinString
Type: Binary
Specifies a Varbinary or Blob value to perform the bitwise NOT operation.
StartBit
Type: Long
Specifies nStartBit as the starting zero-based number of the first bit to perform the operation and nBitCount as the number of bits to perform the operation.
If you do not specify nStartBit and nBitCount, the operation applies to all bits in the expression. If you specify nStartBit only, the operation applies to nStartBit only.
BitCount
Type: Long
Specifies nStartBit as the starting zero-based number of the first bit to perform the operation and nBitCount as the number of bits to perform the operation.
If you do not specify nStartBit and nBitCount, the operation applies to all bits in the expression. If you specify nStartBit only, the operation applies to nStartBit only.

Return Value

Type: Binary
Numeric, Varbinary, or Blob. BitNot( ) returns the bitwise complement of the specified expression. In other words, the return value represents the specified expression with each 0 bit changed to 1 and each 1 bit changed to 0.
Examples
X#
1x = 5  // 0101 binary
2? BitNot(x) // Returns -6
See Also