[jawsscripts] Re: urgent if possible please how2make inputBox info feed in2findString?

Safety counters are a good idea in JAWS While loops indeed, but I
think Windows+JAWSKey+F4 will knock out JAWS even from within one of
those, in case you ever get in a hurry and miss one someday.  I tend
to leave such safety counters in final code though, just in case a
situation crops up that I didn't plan for.  There's this saying:
"Life is what happens while you're making other plans"...

On Mon, May 25, 2009 at 03:48:24PM +0100, Gordon.Luke@xxxxxxxxxxxxxxxx wrote:
No worries Geoff.

Good luck with the old while loop.  After being caught once by an infinite
loop while coding in Jaws script I now always use a counter - just in case.
When coding in a "normal" language it isn't the end of the world if you
create an infinite loop but as Jaws is our main interface into the PC
you're really stuffed as it's just about impossible to kill Jaws without a
reboot as every application seems to slow down as Jaws takes up so much
resource as it's given such a high thread priority.

I usually have something like the following to prevent disaster:

var
      int iLoopCount
...
      let iLoopCount = 0
      while (...whatever your test condition is/are...) && (iLoopCount <
10) ; or whatever upper number you want
            let iLoopCount = iLoopCount + 1
            ...
      endwhile
      ...

Hope this is of some use.

Thanks

Gordon Luke
Capita IT (CAIM)


                                                                       
             "Geoff Chapman"                                           
             <gch@xxxxxxxxxxxx                                         
             t.au>                                                      To
             Sent by:                  <jawsscripts@xxxxxxxxxxxxx>     
             jawsscripts-bounc                                          cc
             e@xxxxxxxxxxxxx                                           
                                                                   Subject
                                       [jawsscripts] Re: urgent if     
                                       possible please how2make inputBox
                                       info feed in2findString?        
             26/05/2009 15:30                                          
                                                                       
             Please respond to                                         
             jawsscripts@freel                                         
                 ists.org                                              
                                                                       
                                                                       




oh wow!~  guys! both of you! thank you so so  much! I think I understand
this now!

This was indeed an absolutely a bran new concept for me!
As you both had obviously deduced, and which you thus spake directly to
below Gordon,
I had mistakenly thought that variables
had to be, populated, or made to become something, only through the use of,

let, statements!
but Now your seeming to indicate to me, that this is not the case.
Well, that indeed was where the missing piece I think, of my mental
understanding was, on this.
so what your saying is, that just putting a declared variable
into  parameter 3 of InputBox, like the, sFind, example below,
will be replaced by whatever data the user types in.
and that this will just autopopulate that variable, with the user
information, such that you can then utilize that bit of variable
hard-coding
in the findString as parameter two, and it'll then of course popluate that
user supplied string data, from the sFind variable, into that findString
function. and thus make it work right.

ok!  That's fantastic! thank you both again so much. I will go away and try

it now, but I'm sure it'll work!
And this sort of situation Gordon, is called a, ByRef", variable, is it?

Now of course, in order to bring this idea to decent fruition,
I do need to enter into yet another hitherto bit of relatively unchartered
waters, of carefully utilizing a while loop, and increase my ISafety
variable by 1, each time it pages down and tries to find said data on New
Screen etc.
And provide a way of bailing out in case the whie statement gets itself
into
an infinite loop, which I've also seen people do. but, I'm going to try to
work on this one a bit more myself tomorrow, and I will report back if I
get
all this working when again connected to the system where i can properly
check things.
Thank you both again so very much for the prompt responses!

Geoff c.

----- Original Message -----
From: "Roy" <shtupler@xxxxxxx>
To: <jawsscripts@xxxxxxxxxxxxx>
Sent: Monday, May 25, 2009 10:21 PM
Subject: [jawsscripts] Re: urgent if possible please how2make inputBox info

feed in2findString?


> hay Geoff
>
> when calling InputBox , try instead of the blank string , putting a
string
> variable; then use that variable in the FindString function as the
> parameter
> to which string to find; maybe it'll work.
> hope this helps
> Roy.
> ----- Original Message -----
> From: "Geoff Chapman" <gch@xxxxxxxxxxxxxxxx>
> To: <jawsscripts@xxxxxxxxxxxxx>
> Sent: Tuesday, May 26, 2009 3:09 PM
> Subject: [jawsscripts] urgent if possible please how2make inputBox info
> feed
> in2findString?
>
>
>> oh mighty scripters.
>>
>> I'm writing kinda fast as I've been trying to configure my email client
>> before ausi bed times for the last hour or so from being away and using
>> someone else's server etc. and I think I've got it now.  But, I really
am
>> stumped on such a simple thing, but I can't figure this out! all I wish
>> to
>> do, is make the inputBox that people pointed me to on this list, feed
the
>> input the user types in, back into a findString function, such that I
can
>> execute this code I've been rabbiting on about over the past few weeks,
>> but
>> now it's really really crunch time for me to get it in or it's never
>> gunna
>> happen! and the supervisor's think that it really would be helpful for
>> efficiency for this vision impaired client on this job, if I could do
>> what
>> I'd like to do.  bottom line is, I just want to be able to solicit input
>> from the user for what they're looking for, and make that input
>> dynamically
>> feed into the findString findString function!
>>
>> But, although I've read the fsdn on it, I just can't for the life of me
>> work
>> out how to do this!
>>
>> as you'll all  know, the fsdn help on inputBox says:
>>
>>
>> 'If you enter text into the Edit box and press the OK button, the text
>> you
>> typed in the Edit box is returned to the calling function by way of the
>> third variable of the function, which is a string variable that is
passed
>> by
>> reference to the calling function.'
>>
>> then a little lower down in the param descriptions, it says:
>>
>> 'Param 3:
>> Type: String
>> Description: This parameter is passed to the calling funcction or script
>> by
>> reference. If you type text in the Edit box and press the OK button,
this
>> parameter returns the text that you typed to JFW. If you do not enter
>> text
>> into the Edit box or you press the Cancel button, this parameter
contains
>> a
>> NULL string,
>> Include: Required
>> * Returns data by reference.'
>>
>>
>>
>>
>>
>> ok so I then tried to figure out, how to make the findString function,
>> somehow call, whatever that exactly means, this inputBox function, by
>> putting the whole inputBox function thing as the second parameter of the
>> FindString function. but then it complained the second param of
>> findString
>> should be of type string not int. and then you see, it claims the whole
>> inputBox actually, returns, again whatever that exactly means, an int
>> value,
>> of 0 if user hits cancel, and 1 if they hit ok! which I presume is why
>> findString is complaining about it returning the wrong kind of data! but
>> it
>> just got through telling me, that it returned the input user string, to
>> the
>> "calling function!" so man i'm confused! again!
>>
>>
>>
>> telline mt thatbeing
>>
>> So, I just don't get this whole, "by reference," thing above!
>>
>>
>>
>> If I just type code like the following:
>>
>>
>>
>> Script MultiScreenFind ()
>>
>>
>>
>> var
>>
>> handle hwnd,
>>
>> int iSafety,
>>
>> int iWhichScreen
>>
>>
>>
>> InputBox ("find what?", "Find", "")
>>
>> ; then user types their data into box and hit enter, and I then want to
>> feed
>> this data into findString, and for jaws cursor to be located on it, then
>> carry out other things:
>>
>> FindString (hwnd, "Here's where user input data has to go but how?",
>> s_top,
>> s_unrestricted")
>>
>>
>>
>> any tips so greatly appreciated! I"m sorry I'm just so pathetically lame
>> at
>> this!
>>
>>
>>
>> geoff c.
>>
>>
>>
>>
>>
>>
>>
>> __________
>> Visit and contribute to The JAWS Script Repository
http://jawsscripts.com
>>
>> View the list's information and change your settings at
>> http://www.freelists.org/list/jawsscripts
>>
>
> __________
> Visit and contribute to The JAWS Script Repository http://jawsscripts.com
>
> View the list's information and change your settings at
> http://www.freelists.org/list/jawsscripts
>

__________
Visit and contribute to The JAWS Script Repository http://jawsscripts.com

View the list's information and change your settings at
http://www.freelists.org/list/jawsscripts




------------------------------------------------------------
This email is confidential and should not be used by anyone who is not
the original intended recipient. Prudential cannot accept liability
for statements made which are clearly the sender's own and not made
on behalf of the Prudential. In addition, no statement should be
construed as giving investment advice within or outside the United
Kingdom

Prudential plc, incorporated and registered in England and Wales.
Registered Office at Laurence Pountney Hill, London, EC4R 0HH.
Registered number 1397169. Prudential plc is a holding company,
subsidiaries of which are authorised and regulated by the Financial
Services Authority (FSA)

'Prudential' is a trading name of The Prudential Assurance Company
Limited, which is incorporated and registered in England and Wales.
Registered Office at Laurence Pountney Hill, London, EC4R 0HH.
Registered number 15454. Authorised and regulated by the Financial
Services Authority. 'Prudential' is also used by other companies within
the Prudential Group, which between them provide a range of financial
products including life assurance, pensions, savings and investment
products

'Prudential' is also a trading name of Prudential Distribution Limited, 
which is incorporated and registered in Scotland.  Registered Office at 
Craigforth, Stirling, FK9 4UE.  Registered number SC212640. Authorised 
and regulated by the Financial Services Authority.

A list of other Prudential companies together with their registered
statutory details can be found in 'About Prudential' on 
http://www.prudential.co.uk

An email reply to this address may be subject to interception or
monitoring for operational reasons or for lawful business practices.

------------------------------------------------------------
__________?
Visit and contribute to The JAWS Script Repository http://jawsscripts.com

View the list's information and change your settings at 
http://www.freelists.org/list/jawsscripts

-- 
Doug Lee, Senior Accessibility Programmer
SSB BART Group - Accessibility-on-Demand
mailto:doug.lee@xxxxxxxxxxxxxxxx  http://www.ssbbartgroup.com
"While they were saying among themselves it cannot be done,
it was done." --Helen Keller
__________ 
Visit and contribute to The JAWS Script Repository http://jawsscripts.com

View the list's information and change your settings at 
http://www.freelists.org/list/jawsscripts

Other related posts: