Richard:
Tnx for the comments, all. 
Just to check my understanding of this issue:

So, the “on preopenstack” message, in a card script, will only get triggered 
once, when the stack is opened? It won’t get triggered when you go to another 
card with an “on preOpenStack” handler??

Bill

On Sep 7, 2014, at 1:02 PM, Richard Gaskin <ambassa...@fourthworld.com> wrote:

> Terence Heaford wrote:
> 
> > Putting it in the card script does seem to be the answer.
> >
> > Had a quick look in the dictionary and I couldn’t find where it says
> > do not put it in the stack script.
> > The dictionary just says the message is sent to the destination card
> > when you open a stack.
> 
> Whether we *should* or *shouldn't* do something depends on what we want to do.
> 
> Once we learn the basics of the message path (in the v6.6.2 User Guide this 
> is in Section 5.3.2, p127), we can anticipate the flow of messages and use 
> them as we need for the task at hand.
> 
> While it may be useful to put initialization things in the first card of the 
> mainstack, having commonly-used routines in the mainstack script can be very 
> useful.
> 
> 
> 
> William Prothero wrote:
> 
> > Interesting, but it seems counter-intuitive to have a handler that
> > references the stack being required to be on a card script.
> 
> I believe this was introduced in HyperCard, and remains a foundational 
> element in most xTalks.  It's useful in allowing us to overload or override 
> how messages are handled differently if we choose based on the context of the 
> current card.
> 
> > Which card? I assume it's the card that first opens in the stack?
> 
> This should always be the current card, so in a case where a stack is being 
> opened the current card will be the first one.
> 
> That said, you can also open stacks via script with things like:
> 
>  open card 2 of stack "SomeStack"
> 
> ...in which case the card script invoked will be for card 2, which gives us 
> the flexibility of handling these sorts of messages however we might want for 
> a given card.
> 
> -- 
> Richard Gaskin
> Fourth World Systems
> Software Design and Development for the Desktop, Mobile, and the Web
> ____________________________________________________________________
> ambassa...@fourthworld.com                http://www.FourthWorld.com
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to