[jawsscripts] Re: Finding Word along a line, not using FindString in whole window

  • From: "Martin Slack" <m.g.slack@xxxxxxxxxxxx>
  • To: <jawsscripts@xxxxxxxxxxxxx>
  • Date: Mon, 15 Oct 2007 07:21:29 +0100

Sorry Geoff, I didn't explain myself well. Functions returning values is quite a general thing. The value doesn't have to be an integer, but it is in the case of the FindString function. This is the mechanism by which the if function decides which of its branches to follow. It evaluates the expression or calls the function which it is to test, and waits for an integer to be returned to it. Then if the value is non zero, it passes execution to the "true" code and ignores the "false" code after the else statement.


 In passing, this does mean that you can do things like:

IntVariable = FindString (parameters)

if you want to save the returned value to play with later.

The main point of my previous email was to emphasize that trying to minimize the number of parentheses used in an if statement is usually a false economy because of the ambiguity which can arise in evaluating complicated expressions.

 hth

Martin


----- Original Message ----- From: "Geoff Chapman" <gch@xxxxxxxxxxxxxxxx>
To: <jawsscripts@xxxxxxxxxxxxx>
Sent: Monday, October 15, 2007 4:25 AM
Subject: [jawsscripts] Re: Finding Word along a line, not using FindString in whole window


right martin! that's great! thanks for this clarification.
I think I get it now.
so, are the two integers returned from this FindString function,
1 if true, and 0 if false? is that right?
so, but like hmm, in what precise sinarios might one need to evaluate a returned integer, as opposed to just using else statements, if the Condition proved false? i.e. if the sttring wasn't found?
so, why wouldn't one just go:
if FindString (WindowHandle, "MyString", s_Next s_Restricted) then
do this,
else
do the other,
EndIf.

Like I hear you that these integers are Returned," by this function, but, not having done this whole game long, I'm just still a tad confused as to why, or in what circumstances, one would need to examine those integers?

Thanks for any further light you'd care to share.

----- Original Message ----- From: "Martin Slack" <m.g.slack@xxxxxxxxxxxx>
To: <jawsscripts@xxxxxxxxxxxxx>
Sent: Monday, October 15, 2007 2:14 AM
Subject: [jawsscripts] Re: Finding Word along a line, not using FindString in whole window


Hi again Geoff,

If you call FindString with the s_next parameter, it will start the search from wherever the Jaws cursor is, and stop at the next occurrence of your string. If you call the function again, it will go on to find the one after that, and so on. With each call, FindString returns an integer to indicate whether the call has been successful or not. This means you can put the call to FindString in an if statement, and execute different code depending on whether the string is found or not.

 hth

Martin


----- Original Message ----- From: "Geoff Chapman" <gch@xxxxxxxxxxxxxxxx>
To: <jawsscripts@xxxxxxxxxxxxx>
Sent: Sunday, October 14, 2007 4:15 PM
Subject: [jawsscripts] Re: Finding Word along a line, not using FindString in whole window


hi david. right! thanks for this man! so, would it keep executing the s_next
movement would it, to the bottom of the window,
until the string was found? or not?
would it keep wrapping lines too in order to do this? of course I guess It
would have to,
but that this would just enable the search to start from a given point in
the window.
is that the deal?
Thanks.
----- Original Message ----- From: "David Maynard" <dmaynard35@xxxxxxxxxxx>
To: <jawsscripts@xxxxxxxxxxxxx>
Sent: Thursday, October 11, 2007 9:40 PM
Subject: [jawsscripts] Re: Finding Word along a line, not using FindString
in whole window




Hi Jeff;

Assuming you are at the beginning of the line try something like this:
FindString (GetCurrentWindow (), "word", s_next, s_restricted)

S_next and s_prior have been documented only once or twice since they
were put in in version 3 or 4.

hth

David Maynard

Franklin NC

dmaynard35@xxxxxxxxxxx


At Thursday 10/11/2007, you wrote:
>Guys, is there a way2, there must be surely, to do a FindString in a
>given area, in this case, along a line, rather than have to use the
>large and clunky, FindString s_top s_Restricted whole deal, where it
>starts from top of whole window and looks all over?
>I wish to just do it more specificly in a certain area/along a given
>line etc, in order to be more elegant and not risk finding the wrong
>occurrance of the string. There must be some function to do it, but
>I just can't think of it right now. any takers?
>
>thanks.
>
>geoff c.
>
>
>
>__________
>View the list's information and change your settings at
>http://www.freelists.org/list/jawsscripts
>
>
>
>--
>No virus found in this incoming message.
>Checked by AVG Free Edition. Version: 7.5.488 / Virus Database:
>269.14.7/1062 - Release Date: 10/10/2007 5:11 PM

__________
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

__________ 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: