[jawsscripts] Re: help with multiple If statement entries not working?

  • From: "David Farough" <David.Farough@xxxxxxxxxxxxx>
  • To: <jawsscripts@xxxxxxxxxxxxx>
  • Date: Thu, 11 Oct 2007 11:13:36 -0400

Hi Geoff:

I think what would be best for this is to use two  parenthesis to start
the condition.  the two or conditions should be within the second
parenthesis so that the ors will be evaluated first.  at the end of the
final or, close the inner parenthesis and then continue with the and
condition. finally closing the last paren following that condition. 
Here is what I mean.  I hope it works as you intend.

if ((GetTextInRect (345, 327, 501, 350) != "TakeAway Unit"


|| GetTextInFrame 
("ConfirmTakeAwayCustomerDetailsTriggerConfirmTakeawayDetailsScreen")
!= 
"Unit")



&& GetTextInRect (273, 327, 417, 350) != "Confirm Take") then



LoadFrameSetFr ("CustomerDetails")



EndIf


David Farough
Application Accessibility Coordinator/coordonateur de l'accessibilité 
Information Technology Services Directorate /
Direction des services d'information technologiques
Public Service Commission / Commission de la fonction publique
Email / Courriel:  David.Farough@xxxxxxxxxxxxx
Tel. / Tél:    (613) 992-2779 

>>> "Geoff Chapman" <gch@xxxxxxxxxxxxxxxx> 06:27 am Thursday, October
11, 2007 >>>
Guys. Sorry to be boring, I'm not that long into scripting, and even
the 
most basic thing seems to be eluding me tonight! and I really would
like 
this to work. if any kind soul could help me debug this simple if
statement?
The Code follows: what I want to say is:
if this condition is so,
or, if this and this condition are so,
then do x. but it isn't working the way I'm writing it, so somethin is

wrong. when I just have the first or, branch of it though, which is the

screen I'm currently working with, it functions fine, so it's something
to 
do with the  multiple statements that I'm messing up,
I've tried putting parens around only the two, and, statements, and
around 
the whole thing from beginning of the first one straight after the if,
and 
at the end, right before the then, which is the way it's written below
here 
now, but neither one seems to function, not that I fvelt it should need

parens around it anywhere really anyway!.
here comes  the code:
if (GetTextInRect (345, 327, 501, 350) != "TakeAway Unit"


|| GetTextInFrame 
("ConfirmTakeAwayCustomerDetailsTriggerConfirmTakeawayDetailsScreen")
!= 
"Unit"



&& GetTextInRect (273, 327, 417, 350) != "Confirm Take") then



LoadFrameSetFr ("CustomerDetails")



EndIf



in the above, the first if statement although definitely true, is not 
working as if the function thinks it's true, i.e. the text is present,
and 
it's been told only if absent to follow through,

yet the LoadFrameSet function is still happily firing!

any help greatly appreciated.

Thank you.



geoff c.



Geoff c.





__________ 
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

Other related posts: