Macro that sets a bit in an integer
Syntax
Usage
result = BitSet(value, bit_number)
Parameters
value
The integer value to set a bit in. It is not modified.
bit_number
The zero-based number of the bit to set; 0 is the least-significant bit. The valid range for this number is 0 to 31, unless
value is a
LongInt, in which case the range is from 0 to 63.
Return Value
value with bit bit_number set to 1.
Description
Macro returning value with the bit bit_number set to 1.
foo = BitSet( bar, 5 ) does the same as foo = bar or (1 shl 5).
Example
Print BitSet(4, 0)
Print Hex(BitSet(1ull, 63))
will produce the output:
5
8000000000000001
Dialect Differences
Differences from QB
See also