Click or drag to resize

BitSet Function (Usual)

X#
Sets a bit to 1 in a value of Numeric, Varbinary, or Blob type and returns the resulting 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 setting the bit.

Namespace:  XSharp.VFP
Assembly:  XSharp.VFP (in XSharp.VFP.dll) Version: 2.19
Syntax
 FUNCTION BitSet(
	Arg1 AS USUAL
) AS BINARY
Request Example View Source

Parameters

Arg1
Type: Usual
Specifies a Numeric or a Varbinary value to set the bit.

Return Value

Type: Binary
Numeric, Varbinary, or Blob. BitSet( ) returns the specified expression with the specified bit set to 1.
Examples
X#
1x = 5  // 0101 binary
2y = 1  // 2nd bit position (0 = 1st bit position)
3? BitSet(x,y) // Returns 7, 0111 binary
See Also