Listen for messages in FrontScripts

Bob Sneidar bobs at twft.com
Tue Jan 3 13:09:54 EST 2012


If I am not mistaken, sent or dispatched messages are always sent to the card if another target is not specified, but of course must "pass through" the frontscript first. I believe that would be the way to put it. That matters because the send command changes the current context of the command as per the documentation:

When the send command is used the stack containing the target handler temporarily becomes the defaultStack. All object references in the message are evaluated in the current context i. e. the defaultStack. Therefore references within the message that refer to "this card" or "this stack" will be referring to the card or stack where the target handler is located. 

This has bitten me in the buttocks once or twice. If you are sending a message to another stack, that stack will become the current context until control returns to the calling script. Dispatch does not do this, or at least the dictionary does not mention that it does. Just a heads up. 

Bob


On Jan 3, 2012, at 9:53 AM, Todd Geist wrote:

> The other tidbit that was really important for me to get is that *All*
> messages have a target. 





More information about the use-livecode mailing list