BitSet Function (Usual, Usual, Usual) | |
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(
BinString AS USUAL,
StartBit AS USUAL,
BitCount AS USUAL
) AS BINARY
public static Binary BitSet(
Usual BinString,
Usual StartBit,
Usual BitCount
)
Request Example
View SourceParameters
- BinString
- Type: Usual
Specifies a Varbinary or Blob expression.
- StartBit
- Type: Usual
Specifies a starting zero-based number of the first bit to perform the operation as nStartBit and the number of bits to perform the operation as nBitCount.
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: Usual
Specifies a starting zero-based number of the first bit to perform the operation as nStartBit and the number of bits to perform the operation as nBitCount.
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:
BinaryNumeric,
Varbinary, or
Blob.
BitSet( ) returns the specified expression with the specified bit set to 1.
Examples 1x = 5
2y = 1
3? BitSet(x,y)
See Also