BitCombine - Make a 16 bit value from two 8 bit values or a 32 bit value from two 16 bit values |
Top Previous Next |
<nReturnValue> := BitCombine( <nLoValue>, <nHiValue>, <nBytesPerValue>, <lNoSignFlag> ) <nLoValue>
The low order component (8 or 16 bits) to be combined into a 16 or 32 bit value. 8 bit values can be in the range of -128 to + 127 (signed) or in the range of 0 to 255 (unsigned). 16 bit values can be in the range of -32768 to 32767 (signed) or in the range of 0 to 65535 (unsigned).
<nHiValue>
The high order component (8 or 16 bits) to be combined into a 16 or 32 bit value. 8 bit values can be in the range of -128 to + 127 (signed) or in the range of 0 to 255 (unsigned). 16 bit values can be in the range of -32768 to 32767 (signed) or in the range of 0 to 65535 (unsigned).
<nBytesPerValue>
Size of <nLoValue> and <nHiValue> in bytes. A value of 1 combines two BYTEs to a WORD and a value of 2 combines two WORD values to a DWORD value.
<lNoSignFlag>
Flag to indicate if the return value should be signed or not. This parameter directs if bit 15 (word) or bit 31 (DWORD) should not be interpreted as a sign bit. Depending on <nBytesPerValue> the two values <nLoValue> and <nHiValue> are combined to a 16 bit or 32 bit integer. The resulting value will be interpreted as a signed (<lNoSignFlag>=.F.) or an unsigned number (<lNoSignFlag>=.T.). BitCombine combines the bit patterns of two integer numbers (8 or 16 bits wide) to a new pattern twice their size. This pattern is interpreted as a signed or unsigned number. This function is used for the data-combination macros found in windef.ch. Core Library: cckptcor.lib / cckptcor.dll
|