bitfirst()

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

Syntax

bitfirst(binary)

Description

Returns the number of the most significant bit with value 1 in a binary field.

The 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.

The following example sets lNumber to the bit number of the first bit set to 1. If all bits are zero, bitfirst() returns -1.

Example

Calculate lNumber as  bitfirst(lBinary)