AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Autohotkey examples9/3/2023 ![]() You leave it by for example using a command or = to assign. Well then there's the problem of knowing when you're in expression syntax, and when you're in the legacy syntax.īy default, you're basically always in an expression. Quotation marks in expression syntax mean we're specifying a string. If we wanted to MsgBox to print the literal text 5+5, and use the expression syntax to do it, we'd do MsgBox, % "5+5". The result of expression's evaluation is going to be passed onto the MsgBox command and the MsgBox is going to print 10. The MsgBox is going to print the literal text 5+5 instead of 10.Īgain, legacy command, but now we're forcing AHK to evaluate an expression here, 5+5. We're using a legacy command, we're not starting the parameter off with a % and a space, so we're using the legacy syntax. If you specify a % followed up by a space at the start of the parameter, you're forcing AHK to evaluate an expression on that parameter instead of reading it as a legacy text parameter. AHK legacy syntax really is a mess.Īll legacy commands (MsgBox for example) use the old legacy syntax on each parameter (unless otherwise specified). The expression syntax is closer to how many other languages behave. The legacy syntax is replaced by expression syntax. ![]() Only reason to wrap in double % would be being stuck behind in the old times, or maybe one could argue it also being more convenient, or something, to write in some cases, but I'm not buying it. Wrapping in double percent signs is legacy AHK and basically there is no need to ever use it anymore. ![]()
0 Comments
Read More
Leave a Reply. |