Please enable JavaScript to view this site.

ESL Documentation

MATHLIB Function

Returns the result of a bitwise "AND" operation.

AND(X_IV, Y_IV)

X_IV

An integer number whose bit settings you wish to test.

Y_IV

An integer number "Mask" containing the value for the bit you wish to check.

Description

The bitwise functions are designed to allow an Esl application to use System API's where individual bits within an integer are used as flags, without the need to write an external routine.

Use this function to test whether a bit within an integer is 1 or zero. The bit to be tested is determined by the value of the "Mask" integer. The function returns the value of the bitwise AND operation, which will be the same value as the "Mask" if the bit is 1 or zero.

Alternatively, use this function to set a selected bit within an integer to zero. In this case the "Mask" integer must contain the value of the required bit that has been XOR 'ed with -1 so the selected bit is toggled to zero and all other bits are set to 1.