[jawsscripts] Pause versus Delay

  • From: "Jim Snowbarger" <Snowman@xxxxxxxxxxxxxxxx>
  • To: <jawsscripts@xxxxxxxxxxxxx>
  • Date: Wed, 2 May 2012 21:26:37 -0500

Have any of you guys ever sussed out the subtle differences between pause and 
delay?  I know what FSDN says about it, but that description doesn't seem 
particularly enlightening or precise to me.
What does it do behind the scenes?  Does jaws get suspended allowing other 
programs to run for both?  Or, just for the pause.   From the description, 
delay doesn't do that.  So, when you are delaying, what happens to the rest of 
your running applications.
I get the impression that they are blocked.
I have always modeled this jaws scrip machine in my head as a single execution 
thread, with  a single priority interrupt.  The main thread runs your scripts 
and the functions they call. the interrupts represent events.
I know you can run a loop containing a pause statement, waiting for an event to 
fire.
I don't know if delay allows that, or it will forestall the event. 
Anyway, do you think that is an accurate model?

I am poking into this because of some serious problems I am having with some 
custom scripts that work fine under jaws 5, and jaws 10, but have issues, as 
they say, with jaws 13.  More about that perhaps as I learn it.  
But, in general, I am finding that lots of things don't work quite the same in 
jaws 13, and I'm having to chase down the anomalies. Great sport, isn't it?  
Hunting down the latest batch of jaws quirks?  Keep your old versions handy!

But anyway, one thing I know about these two builtins is that they behave 
differently if you press a key.

For example, consider the following fragment as part of a script

SayString ("start")
Let i = 20

while (i > 0)

; delay(5)

Pause()

Let i = i-1

EndWhile

SayString ("stop")


Notice that delay is commented out, and pause is not.  You might want to flip 
that around when experimenting.

This total loop takes 2 seconds, no matter which builtin you use, implying that 
Pause is also a 100 millisecond delay, which is what I always believed.

But, one subtle difference is that delay is canceled by keyboard input.
Pause is not.
With delay, once you press a key, all calls to the delay builtin are canceled 
until the running script terminates.
This means that, if your script really needs to do the delay before it takes 
some other action, that action is going to be done prematurely if a key is 
pressed.
This is true in jaws 10, my favorite,  and jaws 13, and probably most if not 
all others.

So what do you experts know about pause versus delay?




__________�

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

Other related posts: