Page 1 of 1

Other methods to interrupt a runaway app?

Posted: Mon Sep 20, 2010 7:38 am
by WaltBrown
Hi!
Does anyone have any tips on interrupting a runaway app? I occasionally (hmm) have algorithms under development, typically recursive, that become uninterruptible by ctrl-dot or ctrl-c (which only seems to happen when I have forgotten to save a couple hours work of course). What I sometimes do is a debugging kluge:

Code: Select all

global gEmergencyStop    -- Set to 0 on openStack
global gWhoaNelly           -- Set to some appropriate max value like 10 million on openStack

-- Called as the first line in all recursive subroutines and major loops
--    as in - eStop "in wbSuspectFunctionName"
on eStop pTargetMessage
   add 1 to gEmergencyStop
   if (gEmergencyStop > gWhoaNelly) then
        answer "eStop" && pTargetMessage
        exit to top
    end if
end eStop
Does anyone have other tips or techniques in this area to share?

Thanks!
Walt

Re: Other methods to interrupt a runaway app?

Posted: Mon Sep 20, 2010 8:02 am
by shadowslash
If it runs / uses repeats, don't forget to add wait 0 millisecs with messages before the end repeat line.

Re: Other methods to interrupt a runaway app?

Posted: Mon Sep 20, 2010 8:07 am
by WaltBrown
Thanks!