private command gotcha

Monte Goulding monte at
Thu Sep 7 19:04:10 EDT 2017

> On 8 Sep 2017, at 8:49 am, Phil Davis via use-livecode <use-livecode at> wrote:
> Clearly the complexity you're painfully aware of is nicely hidden from me by LC script, where I tend to think all things are most likely possible. It's good for bubble-dwellers like myself to occasionally be pulled back into reality. I guess. ;-)

Ah… ok so I probably need to explain this a bit better.

When you set a behavior you don’t just include the behavior object in the message path. There is something more like an instance of the behavior object script attached to the object and this has its own set of script locals so that if the behavior is used multiple times the locals aren’t all mixed up by other users of the behavior. As a result if we wanted private handlers to be supported in the callers script in send and dispatch and we wanted that to also work in behaviors then we would need something interesting… perhaps we could deal with it by allowing dispatch to me from a behavior to flag that it was sent from a particular behavior use so that’s the script that would allow private handlers… anyway… Mark would know what to do ;-)



More information about the Use-livecode mailing list