Page 1 of 1
Can't escape infinite loop without force closing LiveCode..
Posted: Thu Jan 19, 2012 11:16 pm
by xLite
Basically whenever I get into the unfortunate problem of my code creating an infinite loop, due to the "live" nature of LiveCode it forces the application to constantly run and deny me access to the code to fix my mistake.
The only solution is to force close LiveCode everytime which hardly makes my development 2x faster according to your claims.. surely there is some sort of "I made a mistake, temporarily pause the application and let me fix my code" type of button?
Re: Can't escape infinite loop without force closing LiveCod
Posted: Thu Jan 19, 2012 11:20 pm
by jmburnod
Hi,
Did you try to type command and "." on the messagesBox ?
Jean-Marc
Re: Can't escape infinite loop without force closing LiveCod
Posted: Thu Jan 19, 2012 11:33 pm
by sturgis
As mentioned, command -. sometimes stops the loop, you can also attempt to click the messages button on the livecode bar ONCE then walk away for a minute or so and see if it took.
One thing you can do if there is a chance that you'll have a runaway is to put
wait 5 milliseconds with messages -- allows other things to happen in this time space
at strategic locations. Might be a good idea to just get into the habit. this should allow just enough breathing room for a messages button click to be seen and responded too.
Once you get all the kinks out of your logic you can of course remove the waits.
Re: Can't escape infinite loop without force closing LiveCod
Posted: Fri Jan 20, 2012 12:33 am
by dunbarx
All too true. Recursion is usually detected and halted internally, I think after a few hundred thousand passes. Runaway loops, though, are not.
I have found that Cmd-period invariably works in those cases.
Not always, though.
Craig Newman