FT_BITSET() Set selected bit in a byte ──────────────────────────────────────────────────────────────────────────────
Syntax
FT_BITSET( <cByte>, <nBitPos> ) -> cByte
Arguments
<cByte> is a character from CHR(0) to CHR(255).
<nBitPos> is a number from 0 to 7 conforming to standard right-to-left bit numbering convention and representing the position of the bit within the byte.
Returns
Returns new byte, with designated bit set. If parameters are faulty, returns NIL.
Description
In effect, ORs argument byte with a byte that has only the target bit set. If bit is already set, it remains set. Note: Calls FT_ISBIT() which is also in this Library.
This function is presented to illustrate that bit-wise operations are possible with Clipper code. For greater speed, write .C or .ASM versions and use the Clipper Extend system.
Examples
This code would set bit 4 in a byte represented by CHR(107):