OS/2 Procedures Language 2/REXX


Inf-HTML [About][Toc][Index] 0.9b (c) 1995 Peter Childs


BITXOR




 >>--BITXOR(string1-+-----------------------+-)------><
                    +-,-+--------+-+------+-+
                        +-string2+ +-,pad-+

BITXOR returns a string composed of the two input strings logically 
compared bit by bit using the exclusive OR operator. The length of the 
result is the length of the longer of the two strings. If no pad character 
is provided, the XOR operation terminates when the shorter of the two 
strings is exhausted, and the unprocessed portion of the longer string is 
appended to the partial result.  If pad is provided, it is used to extend 
the shorter of the two strings on the right, before carrying out the 
logical operation. The default for string2 is the zero length (null) 
string. 
Here are some examples: 

BITXOR('12'x,'22'x)               ->  '30'x
BITXOR('1211'x,'22'x)             ->  '3011'x
BITXOR('C711'x,'222222'x,' ')     ->  'E53302'x  /* ASCII  */
BITXOR('1111'x,'444444'x)         ->  '555544'x
BITXOR('1111'x,'444444'x,'40'x)   ->  '555504'x
BITXOR('1111'x,,'4D'x)            ->  '5C5C'x
  

Inf-HTML End Run - Successful