Dispatch

Sean Cole sean at pidigital.co.uk
Wed Aug 3 11:38:15 EDT 2022


Awesome Bob,
Thanks for the info. That is really helpful. I often use 'try' to catch
incidents where things trip over, but this might just be more useful and
perform slightly better going forward.

Are there any other tips for its use?

Sean


On Wed, 3 Aug 2022 at 16:23, Bob Sneidar via use-livecode <
use-livecode at lists.runrev.com> wrote:

> Send allows you to send in time. However the command or function must
> exist or you will throw an error. Dispatch cannot use send in time, but if
> a handler does not exist in the message path of the object you dispatch to,
> no error will be thrown.
>
> This can come in handy. Let's say you have assigned a behavior in all your
> fields, but in a few of your fields you have a special handler called
> Cleanup. You can then, 'dispatch "cleanup" to me' in any handler in the
> behavior. The fields that have the cleanup handler will get the message.
> The ones that don't will not throw an error.
>
> Bob S
>
>
> > On Aug 3, 2022, at 07:30 , Craig Newman via use-livecode <
> use-livecode at lists.runrev.com> wrote:
> >
> >> On Aug 3, 2022, at 9:36 AM, Sean Cole via use-livecode <
> use-livecode at lists.runrev.com> wrote:
> >>
> >> Hi all,
> >> I've been thinking about the command 'dispatch'. Is there any
> >> advantage/disadvantage in using it over just calling your handler?
> >> Thanks
> >> Sean
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>


More information about the use-livecode mailing list