Function group | Execute on client | Platform(s) |
---|---|---|
Binary Field | NO | All |
bitmid(binary,firstbitnumber,lastbitnumber)
Returns a binary value identified as a range of bits of a binary field, that is, bitmid() extracts the bits with numbers >=firstBitNumber and <=lastBitNumber.
The first parameter can be a Binary or an Integer; in the case of Binary, you need to provide a variable, and not the result of a calculation.
Note that bit numbers are zero-indexed and bit 0 is the most significant bit.
In the following example, bit lFirstBitNumber of lBinary1 becomes bit zero of lBinary2, and so on.
Calculate lBinary2 as bitmid(lBinary1,lFirstBitNumber,lLastBitNumber)