Hi,
It seems that^ converts decimal numbers to new system
5 ^ 2 = 101 (binary), 5 ^ 3 = 12, 5 ^ 4 = 11, 5 ^ 5 = 10 and 5 ^ 6 and greater
= 5.
You can use following formula too if you wish
var
int a = 5,
int b = 4
(a|b)-(a&b)
Artur
rtr@xxxxxxxxx
-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx <jawsscripts-bounce@xxxxxxxxxxxxx> On
Behalf Of Snowman
Sent: Thursday, April 2, 2020 1:00 AM
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] Exclusive Or
I was surprised to find that jaws script still does not have an exclusive or,
operator.
Am I missing something?
I just want to toggle a bit.
The following code:
d = 1
d = d ^ 2
should toggle bit 2, and result in d = 3 It compiles, but it also clears bit 0,
resulting in d=2
so, basically d=d^2 is the same as d=2
Who knows that the heck that caret means to jaws in that context. but, it does
compile.
Years ago, I had to come up with a work around, and I am a bit surprised to
see that the workaround is apparently still necessary.
d = d & (0-iMask)-1
Is that still the way you have to do this?
+--------------------------------------------------------------------------+
Listen to The Snowman on MushroomFM.com, Saturday evenings, 8PM Eastern time.
60's and 70's tunes, and gently conservative talk.
__________�
View the list's information and change your settings at
http://www.freelists.org/list/jawsscripts
__________�
View the list's information and change your settings at
http://www.freelists.org/list/jawsscripts