Should before [handler name] trigger when using send?

Richard Gaskin ambassador at fourthworld.com
Wed Mar 30 11:17:17 EDT 2016


Paul Dupuis wrote:

> An argument could be made that a before handler SHOULD NOT execute, but
> an after handler SHOULD since the message was sent directly to the
> object (i.e. skipping the normal path and hence the before handler.

I believe an argument could be made in the other direction as well, that 
all secondary effects of an action should happen whether the action is 
triggered by user interaction or via script.

If I use:

   send "go next" to stack "SomeStack"

...I would expect the preOpenCard and openCard handlers to trigger just 
as naturally as if I'd clicked a button initiating that action.

Personally, it seems most natural that the mechanism for preventing the 
triggering of system messages would remain lockMessages.

But that's my own view.  It'll be interesting to hear Mark Waddingham's.

-- 
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  Ambassador at FourthWorld.com                http://www.FourthWorld.com




More information about the use-livecode mailing list