How do I interrupt and cleanup gracefully?
janschenkel at yahoo.com
Mon Dec 1 15:04:04 EST 2003
--- "T. R. Ponn" <alptex2 at orwell.net> wrote:
> Hello all,
> There are a few places in my app where it would be
> nice if the user
> could use a "command-period" interrupt to gracefully
> stop my scripts.
> So, in playing around, I tried this as a starting
> point in a new button:
> on mouseUp
> if the interrupt then cleanThisUp else add 1 to
> end repeat
> end mouseUp
> on cleanThisUp
> put "I'm interrupted" into msg
> end cleanThisUp
> It does, indeed, stop the script, but always with an
> error...and I never
> see the final message in the msg box. This is
> happening in Rev 2.0.3
> IDE on my Mac (OS9.2.2), but must also work in the
> standalones when
> What am I missing?
> Thanks in advance for any help you can lend!
> Best Regards,
> Tim Ponn
The way I read the docs, you should set the local
property allowInterrupts to false before going into
the repeat loop. So the script should look something
set the allowInterrupts to false
if the interrupt
else add 1 to msg
put "I'm interrupted" into msg
A quick test revealed this to work on my Windows
machine. So I hope this helped,
"As we grow older, we grow both wiser and more foolish at the same time." (La Rochefoucauld)
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
More information about the Use-livecode