January 07, 2017

How do I Stop this Endless Loop and other Rampaging Scripts

Whenever you work with loops in any environment it's a good idea to save before running them especially when using recursion.

Stopping a ticking script in Etoys isn't difficult. You can pause it by clicking on it's status box on the Script Editor menu bar or use the AllScripts tool. I learned the hard way that siblings not only inherit scripts but script status as well and one ticking script caused an explosion of siblings across my screen. I think I used the AllScripts tool to stop them all ticking and deleted the siblings. Thank goodness for that reset script.

Any time you want to halt processing you can press alt-. (alt period if that's difficult to see). That will pause any running scripts and bring up the Squeak debugging tool. This is especially useful for infinitely recursive scripts because you then can remove the problem statement tiles from your script, press abandon and review the stopping condition in your script. You may need to step through a non recursive version of your script to see why the stop condition isn't being met.



Last Updated.