Page 1 of 1

"Command" vs "On" command

Posted: Mon May 21, 2018 9:33 pm
by raugert
What's the difference between the following for creating custom commands ?

Code: Select all

command doSomething
-- code
end doSomething
VS

Code: Select all

on doSomething
--code
end doSomething
Is is something to do with the message path ? The reason I ask is because my app was crashing occasionally when I was using "command" in a button script. I changed it to "on" and it seems much more stable ...

I still use "command" for custom commands in the card script. It doesn't seem to affect anything.

Can anyone clarify,
thanks,
Ricard

Re: "Command" vs "On" command

Posted: Mon May 21, 2018 11:25 pm
by FourthWorld
Switching between "on" and "command" should make no functional difference. Please post the code in question and we may be able to help figure out what you're seeing.

Re: "Command" vs "On" command

Posted: Tue May 22, 2018 1:38 pm
by Klaus
Hi Ricard,

what Richard said!

Once upon a time (some years ago) Livecode advised use to use COMMAND for custom handlers to differ them from the build-in commands like "on mouseup" etc.

They said that at some point in the future this would really matter.
This day did not arrive yet, however! :D


Best

Klaus

Re: "Command" vs "On" command

Posted: Tue May 22, 2018 1:50 pm
by raugert
Thanks Klaus and Richard. That answers my question. I didn't think it made any difference. The crashing issue I had, thats now fixed, must be something else I did. :shock:

cheers,
Richard