No Control Break?

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
JackieBlue1970
Posts: 64
Joined: Thu Jan 16, 2020 10:28 pm

No Control Break?

Post by JackieBlue1970 » Tue Feb 04, 2020 12:14 am

Is there no way to break a loop once started in livecode? I was reading a text file and had a thousand rows. As a test, I had the row print on in an answer dialog. I couldn't find any way to break the loop so I had to wait until it ended. Any solution? Seems really strange.

Klaus
Posts: 14193
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: No Control Break?

Post by Klaus » Tue Feb 04, 2020 12:20 am

Hi Jackie,

your "emergency break" is -> CMD . (Dot)
That will throw an error but also stop your loop. :-)

Or do yu mean some condition in your script to end the loop if e.g. the shiftkey = down?

Best

Klaus

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

Re: No Control Break?

Post by dunbarx » Tue Feb 04, 2020 12:59 am

Klaus.

? :wink:

Cmd - period does not throw an error, it just stops execution at that instant, and opens the debugger at the line last executed. Really helpful when things seem to get out of hand.

Craig

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

Re: No Control Break?

Post by SparkOut » Tue Feb 04, 2020 8:24 am

And inside the loop include a line

Code: Select all

wait 0 milliseconds with messages
to ensure the engine does have "moment" to deal with reading the keyboard instead of giving ALL the cycles to the loop.

Klaus
Posts: 14193
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: No Control Break?

Post by Klaus » Tue Feb 04, 2020 6:24 pm

dunbarx wrote:
Tue Feb 04, 2020 12:59 am
Klaus.
? :wink:
:D :D :D

JackieBlue1970
Posts: 64
Joined: Thu Jan 16, 2020 10:28 pm

Re: No Control Break?

Post by JackieBlue1970 » Tue Feb 04, 2020 9:30 pm

Thanks everyone. I'll give the cmd "." a try next time. Jack

Post Reply