Build-time v Run-time

Klaus on-rev klaus at major.on-rev.com
Fri Feb 15 12:05:26 EST 2013


Hi Graham,

Am 15.02.2013 um 17:56 schrieb Graham Samuel <livfoss at mac.com>:

> Another naive questions, but this hasn't happened to me before, or at least I haven't recognised it properly.
> 
> I'm looking at some code written by an associate. As normal (to me) it's a mainstack and a lot of substacks. I want to tinker with the code, so I open the mainstack in the LC IDE, and immediately the program starts to run, even though the Edit tool is active in the toolbar rather than the Browse tool - it starts up and does stuff, like the IDE does. I don't want that, I want the code to remain entirely passive until I tell it to run!
> 
> How does a stack get into 'instant run mode' like that, and what can I do to stop it? Is there some way of creeping up on it so that no handler is executed?
> 
> Actually I noticed that Thierry's Kickstarter monitoring program does the same thing, but I still don't understand it, even tho it only has a few lines of script. What apparently happens is that the preOpenCard handler is executed when the file is opened, but why?

when you open a stack, all "pre-/open-stack/card" handlers will be executed, no matter what the current "tool" is!
You can "lock messages" before opening a stack to prevent this:
...
lock messages
go stack "path/to/stack"
...

Or select "Suppress messages" in the "development" menu in Livecode before opening that stack.
Which does the same.

And don't forget to switch it back afterwards! ;-)

Hope that helps.

> Dumb again
> 
> Graham

Best

Klaus

--
Klaus Major
http://www.major-k.de
klaus at major.on-rev.com





More information about the use-livecode mailing list