"send" vs "dispatch"
Brian Milby
brian at milby7.com
Fri Oct 5 18:16:23 EDT 2018
There is a PR to change this:
https://github.com/livecode/livecode/pull/6479
Will add args to send and call.
Thanks,
Brian
On Oct 5, 2018, 6:09 PM -0400, 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