[jawsscripts] Exclusive Or

  • From: "Snowman" <snowman@xxxxxxxxxxxxxxxx>
  • To: <jawsscripts@xxxxxxxxxxxxx>
  • Date: Wed, 1 Apr 2020 17:00:08 -0500

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

Other related posts: