BitTest Function (Usual, Usual) | |
Determines whether a specific bit in a Numeric, Varbinary, or Blob value is set to 1.
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.19
Syntax FUNCTION BitTest(
Arg AS USUAL,
Bit AS USUAL
) AS LOGIC
public static bool BitTest(
Usual Arg,
Usual Bit
)
Request Example
View SourceParameters
- Arg
- Type: Usual
Specifies the Numeric value to check for the specified bit.
- Bit
- Type: Usual
Specifies the bit position in nExpression1 to check. nExpression2 can range from 0 to 31 with 0 as the bit farthest to the right.
Return Value
Type:
Logic
Logical.
BitTest( ) returns True (.T.) if the specified bit is set to 1; otherwise, it returns False (.F.).
Examples 1Clear
2? '2 even? '
3?? IsEven(2)
4? '3 even? '
5?? IsEven(3)
6? '0 even? '
7?? IsEven(0)
8? '-13 even? '
9?? IsEven(-13)
10Function IsEven
11PARAMETER nInteger
12RETURN NOT BitTest(nInteger, 0)
See Also