Can't escape infinite loop without force closing LiveCode..

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
xLite
Posts: 11
Joined: Mon Jun 20, 2011 4:13 pm

Can't escape infinite loop without force closing LiveCode..

Post by xLite » Thu Jan 19, 2012 11:16 pm

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?

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Can't escape infinite loop without force closing LiveCod

Post by jmburnod » Thu Jan 19, 2012 11:20 pm

Hi,

Did you try to type command and "." on the messagesBox ?

Jean-Marc
https://alternatic.ch

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: Can't escape infinite loop without force closing LiveCod

Post by sturgis » Thu Jan 19, 2012 11:33 pm

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.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10320
Joined: Wed May 06, 2009 2:28 pm

Re: Can't escape infinite loop without force closing LiveCod

Post by dunbarx » Fri Jan 20, 2012 12:33 am

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

Post Reply