Simple Scoping Question

Scott Rossi scott at tactilemedia.com
Wed Apr 20 14:19:02 EDT 2005


Recently, David Burgun  wrote:

> I hadn't realized that the openStack handler gets called when doing a
> Save. What is the recommended action for handle this?
> 
> I could do one of three things:
> 
> 1.  Check if myStackFileName is empty and if so skip the "start uisng"
> 2.  Check the Stack Name for "revSaving" and if so skip the "start uisng"
> 3.  Check if in "development" moce and if so  skip the "start uisng"
> 
> I suppose I need similar tests in preOpenStack and closeStack?
> 
> Can anyone tell me the best thing to do under this condition?

If your openStack handler is only supposed to apply to your main stack, then
place the openStack handler in the script of the *first card* of your main
stack (this goes for any initialization handlers since they are only called
when the first card is opened).  Any subsequent opening/closing of stacks
will not trigger the init handler/s.

If your openStack handler must apply to any substacks of your main stack,
you can do as you suggest above: check the stack's name, for development
mode, etc.

Regards,

Scott Rossi
Creative Director
Tactile Media, Multimedia & Design
-----
E: scott at tactilemedia.com
W: http://www.tactilemedia.com



More information about the use-livecode mailing list