Page 1 of 1

Desperately need help - infinite loop!

Posted: Thu Mar 24, 2016 8:13 pm
by tjm167us
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

Re: Desperately need help - infinite loop!

Posted: Thu Mar 24, 2016 8:17 pm
by dunbarx
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

Re: Desperately need help - infinite loop!

Posted: Thu Mar 24, 2016 8:54 pm
by [-hh]
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 ;-)

Re: Desperately need help - infinite loop!

Posted: Thu Mar 24, 2016 9:46 pm
by SparkOut
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.

Re: Desperately need help - infinite loop!

Posted: Thu Mar 24, 2016 9:55 pm
by tjm167us
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"

Re: Desperately need help - infinite loop!

Posted: Fri Mar 25, 2016 4:55 am
by dunbarx
Hermann.
p.s. Hi Craig, did you change your name (to Nemwan)?
That's mighty tough talk from a negative square.

Criag