openStack Initialization Issues

Jeanne A. E. DeVoto revolution at jaedworks.com
Mon Feb 27 15:19:00 EST 2006


At 8:34 PM -0700 2/26/2006, Arthur Urban wrote:
>Is there a way I can detect when my main stack receives the 
>openStack message versus when my substacks receives the message and 
>pass it all the way down to the mainstack? I do once only 
>initialization in my mainstack, and I can't seem to reliably detect 
>when a substack is triggering the openStack message and skip over 
>the init code. I've tried using the target and the me function, 
>nothing seems to work. Too bad there is no openMainStack handler. 
>(even using on startUp doesn't help me) Ugh...what am i missing? 
>thanx!

In the alternative to Richard's suggestion, you can also check the 
target function in the handler. The target is the object that 
originally received the message, so if openStack is responding to a 
substack, the opening card of the substack is the target:

   on openStack
     -- do anything you need to do for all stacks here
     if the owner of the target is not me then pass openStack
     -- do main stack-specific things here
   end openStack
-- 
jeanne a. e. devoto ~ revolution at jaedworks.com
http://www.jaedworks.com



More information about the use-livecode mailing list