openStack Initialization Issues

Richard Gaskin ambassador at fourthworld.com
Mon Feb 27 01:23:24 EST 2006


Arthur Urban wrote:

> Richard Gaskin wrote:
>> If you put your mainStack's initialization into the card script of 
>> your mainStack you never need to worry about substacks triggering it.
>
> That sure is mighty clever...I might even have to do that. I'm surprised 
> that there is no "official" and "correct" way to deal with this, but 
> perhaps as more folks see this thread, a non-workaround might arise. 
> Thank you so much for the input! :)

In my office, that's the official way.

If you really want to filter in the mainStack script you can use 
something like:

   on preOpenStack
     if the short name of this stack = the short name of me then
       -- do initialization
     end if
   end preOpenStack


That's the thing with Transcript:  there are often many ways to solve a 
given problem. Which one is "best" may often depend on the specifics of 
the task at hand.

Using the message path smartly in lieu of conditionals is not 
necessarily a workaround.  Sometimes it lends itself to cleaner, simpler 
code.

There may be other items of interest with regard to the message path here:
<http://www.fourthworld.com/embassy/articles/revolution_message_path.html>

--
  Richard Gaskin
  Managing Editor, revJournal
  _______________________________________________________
  Rev tips, tutorials and more: http://www.revJournal.com



More information about the Use-livecode mailing list