Infinite loops !

Sarah Reichelt sarah.reichelt at
Thu Jan 31 18:16:14 EST 2008

On Feb 1, 2008 2:11 AM, René Micout <rmicout at> wrote:
> Hello from Paris,
> I have a question about infinite loops.
> I make a musical arpeggiator (a virtual replica Reactogon see video :
> reminds-me-of-star-trek/), the work is progressing but I have 2
> encountering problems: 1 / When I start an endless loop (it is the
> goal of the program, I stop it by pressing a key) it stop after few
> time with the following message: "Handler: can't find handler" while
> it worked for 150 or 200 times...
> 2 / It is not possible to intervene at any time in the running of the
> program to change certain provisions

Hi Rene,

I think using infinite recursions is a bad idea. Even if you set the
recursionLimit to a high number, if the program is left running for
long enough it will reach that limit. I would suggest you use "send"
instead. Try something like this:

on doLoop
   -- see if the key is presses to stop the loop and if so, exit here
   -- read the data from your controls to see if anything has changed
   -- do whatever processing is needed
   -- send "doLoop" to me in 1 second (or whatever time interval you want)
end doLoop


More information about the use-livecode mailing list