$and

Performs a bit-wise AND of two values.

Syntax

$and(char1,char2)

Parameters

char1

a character string, or an expression that evaluates to a character string

char2

a character string, or an expression that evaluates to a character string

Return Value

Character string.

Comments

The $and function combines the bit patterns of two characters in the fashion of a Boolean AND and returns the resulting character. If the char1 or char2 string contains more than one character, only the first character in the string (one byte) is processed. You can express char1 and char2 as hex codes (e.g., \6E).

Example

$ and("\0E","\0F")

The bit pattern of hex 0E is 00001110 and of hex 0F is 00001111. The above expression returns the bit pattern 00001110 (character hex 0E).

 

Related Topics