Make your own free website on Tripod.com
3.2.6. BITAND(string1[,[string2][,padchar]])

Returns the result from bytewise applying the operator AND to the
characters in the two strings string1 and string2. Note that this
is not the logical AND operation, but the bitwise AND operation.
String2 defaults to a nullstring. The two strings are left-
justified; the first characters in both strings will be ANDed,
then the second characters and so forth.

The behavior of this function when the two strings do not have
equal length is defined by the padchar character. If it is
undefined, the remaining part of the longer string is appended to
the result after all characters in the shorter string have been
processed. If padchar is defined, each char in the remaining part
of the longer string is logically ANDed with the padchar (or
rather, the shorter string is padded on the right length, using
padchar).

When using this function on character strings, e.g. to uppercase
or lowercase a string, the result will be dependent on the
character set used. To lowercase a string in EBCDIC, use BITAND()
with a padchar value of bfx. To do the same in ASCII, use
BITOR() with a padchar value of 20x.

     BITAND(123456x, 3456x)         >   101456x
     BITAND(foobar,, dfx)      >   FOOBAR /*For ASCII*/
     BITAND(123456x, 3456x, f0x)  >   101450x



PREV NEXT