Want to stop scripts running when I am debugging

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

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2990
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: Want to stop scripts running when I am debugging

Post by mwieder » Fri Jan 17, 2020 6:54 pm

It's not a "suggestion"... it's in the dictionary. :P

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7647
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Want to stop scripts running when I am debugging

Post by FourthWorld » Fri Jan 17, 2020 8:06 pm

mwieder wrote:
Fri Jan 17, 2020 6:54 pm
It's not a "suggestion"... it's in the dictionary. :P
I meant no offense by crediting your earlier post with the solution.

I'm curious: which token is that under in the Dictionary? Mainstack? preOpenStack? Something else?

One of the challenges of good docs is figuring out where to put useful things so they can be more easily found.
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2990
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: Want to stop scripts running when I am debugging

Post by mwieder » Fri Jan 17, 2020 10:17 pm

Indeed.
Look at the openStack or preOpenStack entry in the dictionary.
Sent to the destination card right after you open a stack.
You can, of course, put the openStack or preOpenStack handlers in the stack script, and they'll get executed if there's no handler in the card script, but then you run into the problem that Kaveh found, where you have to either check what the target stack is or else put corresponding openStack handlers in any substacks. Much cleaner to keep the handler in the card script where it belongs.

kaveh1000
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 435
Joined: Sun Dec 18, 2011 7:23 pm
Location: London
Contact:

Re: Want to stop scripts running when I am debugging

Post by kaveh1000 » Sat Jan 18, 2020 10:21 am

Thank you Mark. Clear in hindsight. I think because of the name "OpenStack" I just assumed that is where it should go. Indeed Sent to the destination card right after you open a stack. could not be more clear!

And yes, I have had to put exactly a line to say exit if the stack is not the main stack. ;-)
Kaveh

Post Reply

Return to “Talking LiveCode”