bitmid()

Function group Execute on client Platform(s)
Binary Field NO All

Syntax

bitmid(binary,firstbitnumber,lastbitnumber)

Description

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.

In the following example, bit lFirstBitNumber of lBinary1 becomes bit zero of lBinary2, and so on.

Example

Calculate lBinary2 as  bitmid(lBinary1,lFirstBitNumber,lLastBitNumber)