LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!
The "command" token is meant to help distinguish between messages the engine sends and custom handlers you write yourself. So you would use "on mouseUp" because that's a built in message, and "command myOwnHandler" for those you've written.
They do act as synonyms functionally.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
jacque wrote:The "command" token is meant to help distinguish between messages the engine sends and custom handlers you write yourself. So you would use "on mouseUp" because that's a built in message, and "command myOwnHandler" for those you've written.
Exactly!
And once upon a time the mothership advised us to really make this difference
due to possible future changes in the engine, which would make this actually neccessary!
Thanks for your help. I hope at some point the user guide, lessons and dictionary will be updated to say these are synonyms and include the explanations you've given.
I am constantly being reminded that synonyms are discouraged. Nonetheless, these are synonyms and I use them in the manner described above, with the addition that anything that will be the object of a "send" or "dispatch" command I treat as a message, and therefore use the "on" format.
The "on" format has been part of the language since the days of the dinosaurs, and changing that would break nearly every stack in existence. The "command" format, while newer, is now a part of the language, and thus also won't change without breaking backward compatibility.
Why are synonyms discouraged? Having multiple ways to write the same thing allows more folks express themselves in a manner that suits them. It also makes the language feel more natural and less syntactic. If you have ever yelled at your phone because Siri/Cortana/Alexa/Google Now are soooooooooooooooooooo STUPID, you get the idea.