I more suspect that JAWS' parsing of the ^ symbol is inconsistent and that
therefore use of the operator is not safe. When I tested it many years ago, it
was that way; and I find it still is:
You get the discussed results with things like sayInteger(5 ^ 2), but in other
setups you just get a copy of the first or second argument:
void function caretTest(int a, int b)
sayInteger(a ^ b)
endFunction
caretTest(5, 2)
does not result in 101; I get 5.
int function caretTest(int a, int b)
return (a ^ b)
endFunction
sayInteger(caretTest(5, 2))
gives me 2.
On Wed, Apr 01, 2020 at 11:30:15PM -0500, Snowman wrote:
CAUTION: This email originated from outside of the organization. Do not click
links or open attachments unless you recognize the sender and know the content
is safe.
that is interesting. I wonder what is the use for that in jaws script land.
you are saying that it converts a number in base ten over to the equivalend
in a new base.
5 in base ten, decimal, is 101 in binary etc.
However you learned that, Thanks for the explanation.
+--------------------------------------------------------------------------+
Listen to The Snowman on MushroomFM.com, Saturday evenings, 8PM Eastern
time.
60's and 70's tunes, and gently conservative talk.
----- Original Message -----
From: "Artur Räpp" <rtr@xxxxxxxxx>
To: <jawsscripts@xxxxxxxxxxxxx>
Sent: Wednesday, April 01, 2020 5:38 PM
Subject: [jawsscripts] Re: Exclusive Or
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
__________�
View the list's information and change your settings at
http://www.freelists.org/list/jawsscripts
--
Doug Lee, Lead Accessibility Architect
Level Access - over 1,000 organizations trust us to help them achieve and
maintain digital accessibility compliance!
mailto:Doug.Lee@xxxxxxxxxxxxxxx http://www.LevelAccess.com
"While they were saying among themselves it cannot be done, it was done."
--Helen Keller
__________�
View the list's information and change your settings at
http://www.freelists.org/list/jawsscripts