Re: How do I interrupt and cleanup gracefully?

2003-12-01 Thread Jan Schenkel
--- "T. R. Ponn" <[EMAIL PROTECTED]> wrote:
> Jan,
> 
> I tried it and it failed (the IDE locked up)...then
> I added the obvious 
> (exit to top).  And, just to make sure things were
> back where they're 
> supposed to be, I added "set allowInterrupts to
> true".  Badda-bing! 
>  That did it!
> 
> Though not a biggie, I'm still struggling with
> understanding the logic: 
> set allowInterrupts to false = allow the user to
> interrupt.  Sounds 
> backwards to me. :-D
> 
> Thanks!
> 
> on mouseUp
>   put empty into msg
>   set the allowInterrupts to false
>   repeat
> if the interrupt
> then cleanThisUp
> else add 1 to msg
>   end repeat
> end mouseUp
> 
> on cleanThisUp
>   put "I'm interrupted" into msg
>   set the allowInterrupts to true
>   exit to top
> end cleanThisUp
> 
> 
> Best Regards,
> 
> Tim Ponn
> 
> 

Hi Tim,

Well you have to read it as follows:
- if the allowInterrupts is true, the user can
interrupt the script at any time, even in a situation
that would leave data in an incorrect state.
- if the allowInterrupts is false, then the user can
still send the interrupt keystroke, but the developer
decides when to handle the interrupt, and how to clean
up and exit gracefully.

Hope this clarified things a bit,

Jan Schenkel.

=
"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
http://antispam.yahoo.com/whatsnewfree
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: How do I interrupt and cleanup gracefully?

2003-12-01 Thread T. R. Ponn
Jan,

I tried it and it failed (the IDE locked up)...then I added the obvious 
(exit to top).  And, just to make sure things were back where they're 
supposed to be, I added "set allowInterrupts to true".  Badda-bing! 
That did it!

Though not a biggie, I'm still struggling with understanding the logic: 
set allowInterrupts to false = allow the user to interrupt.  Sounds 
backwards to me. :-D

Thanks!

on mouseUp
 put empty into msg
 set the allowInterrupts to false
 repeat
   if the interrupt
   then cleanThisUp
   else add 1 to msg
 end repeat
end mouseUp
on cleanThisUp
 put "I'm interrupted" into msg
 set the allowInterrupts to true
 exit to top
end cleanThisUp
Best Regards,

Tim Ponn

Jan Schenkel wrote:

--- "T. R. Ponn" <[EMAIL PROTECTED]> 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
 repeat
   if the interrupt then cleanThisUp else add 1 to
msg
 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 
completed.

What am I missing?

Thanks in advance for any help you can lend!

Best Regards,

Tim Ponn

   

Hi Tim,

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
like :
--
on mouseUp
 set the allowInterrupts to false
 repeat
   if the interrupt
   then cleanThisUp
   else add 1 to msg
 end repeat
end mouseUp
on cleanThisUp
 put "I'm interrupted" into msg
end cleanThisUp
--
A quick test revealed this to work on my Windows
machine. So I hope this helped,
Jan Schenkel.

=
"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
http://antispam.yahoo.com/whatsnewfree
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution
 

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: How do I interrupt and cleanup gracefully?

2003-12-01 Thread Jan Schenkel
--- "T. R. Ponn" <[EMAIL PROTECTED]> 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
>   repeat
> if the interrupt then cleanThisUp else add 1 to
> msg
>   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 
> completed.
> 
> What am I missing?
> 
> Thanks in advance for any help you can lend!
> 
> Best Regards,
> 
> Tim Ponn
> 
> 

Hi Tim,

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
like :
--
on mouseUp
  set the allowInterrupts to false
  repeat
if the interrupt
then cleanThisUp
else add 1 to msg
  end repeat
end mouseUp

on cleanThisUp
  put "I'm interrupted" into msg
end cleanThisUp
--

A quick test revealed this to work on my Windows
machine. So I hope this helped,

Jan Schenkel.

=
"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
http://antispam.yahoo.com/whatsnewfree
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


How do I interrupt and cleanup gracefully?

2003-12-01 Thread T. R. Ponn
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
 repeat
   if the interrupt then cleanThisUp else add 1 to msg
 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 
completed.

What am I missing?

Thanks in advance for any help you can lend!

Best Regards,

Tim Ponn

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution