Desperately need help - infinite loop!

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
tjm167us
Posts: 50
Joined: Sat Dec 03, 2011 8:27 pm

Desperately need help - infinite loop!

Post by tjm167us » Thu Mar 24, 2016 8:13 pm

Hi guys,
I made a very silly mistake and I am afraid I may be stuck. I have a wait x milliseconds inside of an infinite main loop that gets called from my preOpenStack. Of course, in hind sight, I should have done wait x milliseconds with messages, but I had a lapse of judgement. To make matters worse, I haven't saved in two hours, and I think everyone here knows how much you get done with LiveCode in that time!

Now, if there was any good news at all, I was able to frantically hit the close enough times to actually catch it before I was executing the wait. I pressed save, and I think I actually saved it! But I can obviously not reopen the file without getting into the loop again.

So, my question is:
Am I out of luck, or is there a way I can open livecode and subsequently the file so I can fix my mistake before preOpenStack gets called?
File is attached out of desperation!

Thanks,
Tom
Attachments
Traffic Light FSM.zip
(2.29 KiB) Downloaded 223 times

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

Re: Desperately need help - infinite loop!

Post by dunbarx » Thu Mar 24, 2016 8:17 pm

Hi.

Welcome to our world.

I always put a line: "if the optionKey is down exit to top" in every loop I throw together that may not have a way out.

When I say every time, I mean I do it after I get caught like you did.

Make another stack, or in the msg box, and do this:

Code: Select all

edit the script of stack "yourInfiniteLoopStack"
Get in there and dig out the offending line, or lack of line.

Craig Newman

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm

Re: Desperately need help - infinite loop!

Post by [-hh] » Thu Mar 24, 2016 8:54 pm

If it is still running, then hit cmd-period several times (on win and linux ctrl-period).

p.s. Hi Craig, did you change your name (to Nemwan)?
See 'shorten strings...'.
All teh bset , Hremann ;-)
shiftLock happens

SparkOut
Posts: 2947
Joined: Sun Sep 23, 2007 4:58 pm

Re: Desperately need help - infinite loop!

Post by SparkOut » Thu Mar 24, 2016 9:46 pm

If it is closed, then use the "envelope" icon in the menu bar of the ide to disable messages. Then you can open the stack again and it will not fire up the script in preOpenStack, so you can make edits and restore sanity.

tjm167us
Posts: 50
Joined: Sat Dec 03, 2011 8:27 pm

Re: Desperately need help - infinite loop!

Post by tjm167us » Thu Mar 24, 2016 9:55 pm

Craig,
THANK YOU, I was able to recover what I thought I lost - PHEW, lesson learned!
To add onto what was probably clear to everyone but myself, you have to include the file path of the file you are interested in since the stack is not currently open. So for me, I typed the following into the message box:

Code: Select all

edit the script of stack "C:\Users\tom\Desktop\Traffic Light FSM.livecode"

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

Re: Desperately need help - infinite loop!

Post by dunbarx » Fri Mar 25, 2016 4:55 am

Hermann.
p.s. Hi Craig, did you change your name (to Nemwan)?
That's mighty tough talk from a negative square.

Criag

Post Reply