**DONOTDELETE**
(Lurker)
2001-05-01 04:05 PM
I would like a Bitwise XOR function

Currently AND, OR and NOT are boolean (returning 1 or 0),and & and | are bitwise.
A bitwise 'Exclusive OR' would help in setting/clearing bitfields (used in file properties and Windows Dialog boxes etc)
(Any suggestions on a symbol to represent it?)


ShawnAdministrator
(KiX Supporter)
2001-05-01 04:10 PM
Re: I would like a Bitwise XOR function

How about ^

Shawn.

cj
(MM club member)
2001-05-01 06:03 PM
Re: I would like a Bitwise XOR function

Excellent idea. If you need an X(n)OR function in the meantime, try this:

$eCode=chr((asc($sCode) & $iEncrypt) | (255-(asc($sCode) | $iEncrypt)))

if Z = A xor B then $eCode = $sCode xor $iEncrypt.

cj

[This message has been edited by cj (edited 01 May 2001).]

**DONOTDELETE**
(Lurker)
2001-05-03 12:34 AM
Re: I would like a Bitwise XOR function

If all you want to do is set and reset bits you don't need an XOR function, as the & and | perform those functions. XOR would be more suited to toggling bits.

**DONOTDELETE**
(Lurker)
2001-05-02 07:13 PM
Re: I would like a Bitwise XOR function

Is it me, or does cj's code return the inverse of the xor result?
if $A = %1010
$B = %1100
then =====
$A xor $b = %0110

so I think the code should be:
$Z = ($A | $B) & (-1 -($A & $B))

kholm
(Korg Regular)
2001-05-03 12:01 AM
Re: I would like a Bitwise XOR function *DELETED*

Post deleted by kholm

cj
(MM club member)
2001-05-03 01:19 AM
Re: I would like a Bitwise XOR function

AJH, it is not you, that is an XNOR function

Thanks for the XOR version

cj

NTDOCAdministrator
(KiX Master)
2001-05-19 11:14 AM
Re: I would like a Bitwise XOR function

Well most of you guys seem to be more of programmers then Admins...
Perhaps ones that have turned into LAN/WAN Administrators.
Here is a link to another site that has some more information on this stuff that may help
the rest of us to learn more.
http://www.logicalexpressions.com/vbtip.htm

------------------
NTDOC...
The dark side is quicker, easier, more seductive.

If you choose the quick and easy path, you will become an agent of evil.

LonkeroAdministrator
(KiX Master Guru)
2005-08-19 01:36 AM
Re: I would like a Bitwise XOR function

this is an old thread or actually topic but.
in 4.50 your wishes came trough.

long after the termination of your user account though...