"send" vs "dispatch"

Peter Bogdanoff bogdanoff at me.com
Sat Oct 6 00:16:19 CEST 2018


I’m finding it’s best to do this when you “send” and have a parameter:

send “test ha” to button 1


Peter Bogdanoff
ArtsInteractive

> On Oct 5, 2018, at 3:08 PM, Geoff Canyon via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> A word to the wise (mostly for IDE and extension developers): this will
> successfully compile:
> 
>   send "test" to button 1 with "ha"
> 
> And then if the IDE is swallowing up your error messages (as it does for
> extensions like Navigator) it will even deliver the message "test" to
> button 1, just without any arguments, and then die silently.
> 
> Outside of "rev" stacks, it will deliver the message without arguments and
> then throw an error saying there is no handler "with". I just checked, and
> amazingly this will work:
> 
> on mouseUp
>   send "test" to button 1 with "ha"
> end mouseUp
> 
> on with
>   answer "WTH?"
> end with
> 
> But that's obviously unlikely. Far more likely if you're dealing with
> code you wrote before you became aware of "dispatch" (or maybe before
> "dispatch" was a thing -- I think Navigator predates LC 3.5) is that you
> decide to add an argument to a remote call and don't notice that it's a
> "send" rather than a "dispatch", and then spend half an hour trying to
> figure out why your arguments aren't passing through <grumble>.
> _______________________________________________
> 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