Escape infinite loops

Ben Rubinstein benr_mc at cogapp.com
Mon Jul 3 04:55:40 EDT 2006


On 7/2/06 10:36 PM, "Terry Vogelaar" <tvogelaar at de-mare.nl> wrote:
 > Back in the HyperCard days I ran more often into such an error. I had
 > to use Command-dot often to stop executing scripts. But RunRev 2.7
 > doesn't seem to respond to that. So I force-quit RunRev. But is there
 > another way to abort executing scripts?
 >
 > Also, is there a way to give a handler a maximum time to finish?

n 3/7/06 07:03, Jim Ault wrote:
> look in the archives of posts from last two weeks, where this was discussed
> fairly well.
>  
> link to archives
> http://www.mail-archive.com/use-revolution@lists.runrev.com/
> 
> Basically---------------
> 
> Rule 1   make sure the "user can't abort scripts" is false (un-checked)
> 
> if the optionkey is down then breakpoint
> if the optionkey is down then exit to top
> if the optionkey is down then exit repeat
> 
> put the seconds into noww
> repeat forever
> if the seconds - noww > (24*60*60) then it is tomorrow
> end repeat
> 
> put 0 into cntr
> repeat forever
> add 1 to cntr
> if cntr > 43562121 then breakpoint
> end repeat


Jim's right to point to that thread - and the various strategies he mentions 
are all good - but actually towards the end of the thread it was established 
that the leading issue was that in 2.7.x, the global property 
"allowInterrupts" has been set false by default - it should be 'true'.  With 
this property set to true, command-dot works as you expect (except in certain 
cases with modal dialogs open, which led to the rest of the discussion above).

As to giving a handler a maximumm time to finish, AFAIK there is no way to do 
this from 'outside' the handler - ie as Jim hints, you'd need to build this 
into your handler in some way.

   Ben Rubinstein               |  Email: benr_mc at cogapp.com
   Cognitive Applications Ltd   |  Phone: +44 (0)1273-821600
   http://www.cogapp.com        |  Fax  : +44 (0)1273-728866




More information about the use-livecode mailing list