Thanks Brian - I'll respond to your nice example later, once I've had a chance to test something.
I hope you don't mind me quizzing you on this, because to my mind it still doesn't make sense... and I'd like it to
bwmilby wrote: ↑Thu May 09, 2024 4:28 pm
'before' and 'after' don't change the message path. They are additional messages that get handled without altering the standard message path. Regardless of what the 'before' handler does the message goes to the object normally.
The path
does change with 'before' - the handler in the behavior is executed first, then the handler in the object, which is not the normal message flow as I understand it.
bwmilby wrote: ↑Thu May 09, 2024 4:28 pm
Regardless of what happens in the object, the 'after' handler is called before the message goes past the object
This I don't understand. I fail to see the logic in saying this all happens before it goes past the object?
If 'after' is called after the message is in the object, then effectively the message is handled in the behavior, not the object. It doesn't go back to the object it either stops in the behavior or is pushed up the message path. Or have I misunderstood?
bwmilby wrote: ↑Thu May 09, 2024 4:28 pm
One possibility is the "on" is the default action for the behavior. It could be overridden by the control. The developer may also want something to happen even if the default handler was overridden and would use the "after" to do so.
My point is if you are in the same script always executing the same process with an 'on' followed by an 'after', you might as well handle everything in one of the two. Yes you can do as you say, but I fail to see any benefit whatsoever, other than perhaps splitting a super long handler into two...
Then again LC lets us do *lots* of things we shouldn't be doing lol