- Thanks for this thread.
FUNCTIONS V. COMMANDS (AND %)
- 99% of the time, these are equivalent:
Code: Select all
Cmd, % VarName, % "LiteralString", ByRefVar, LiteralNum, % 1+1, % var1 var2
Func(VarName, "LiteralString", ByRefVar, LiteralNum, 1+1, var1 var2)
- The exception is mentioned here, the use of
% %var% in commands:
'force an expression' and 'can be an expression' - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=14&t=37224
- In AHK v2 you can use functions for everything, and I backported these functions:
commands as functions (AHK v2 functions for AHK v1) - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=37&t=29689
AHK_ID/AHK_CLASS
- The 'hWnd' was deemed too hard for the casual user, but you can use it via
"ahk_id " hWnd, and by itself in AHK v2.
- You can use DllCall to call Winapi functions.
- My general view is that AHK shines because it thinks about the casual user, yet also shines when it makes things straightforward for seasoned programmers.
SINGLE-LINE IF-STATEMENT
- I've said that this should be added in. The question is what syntax. Perhaps the smart detection of parentheses (but this could be buggy) and/or a 'then' keyword for a simpler safer implementation.
- Using the ternary operator with functions/expressions can achieve a lot, although this can't be used with return/break/continue.
- You could just have an operator added in, equivalent to a line separator (equivalent to carriage return/line feed), to bunch lines up.
FURTHER READING
Wish List 2.0 - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=13&t=36789
CONCLUSION
- Before continuing, I should state that I'm just about ready to leave this forum.
- People rightly complain about the current AHK syntax, it can be 95% fixed just by backporting the AHK v2 functions and AHK v2 GUI objects, which I've done. Ultimately AHK v2 will fix everything.
- Once you've taken actions to negate the current problems, you realise that AHK actually has a lot of strengths compared to other languages, making it far easier to program with.
- What I find very difficult to understand is, as AHK v2 was taking longer and longer, why didn't people push for key, simple but important changes to be made to AHK v1. Maybe they thought that making small improvements to AHK v1 would delay the release of AHK v2, but this is naive, and in the end you get a flawed AHK v1 and a far-away-as-ever AHK v2, you get nothing.
- Btw I have managed to speed up getting various AHK v1/v2 problems fixed via my wish list, bug reports, encouraging people to add a '+1' for certain ideas and obviously the hard work of the dev, including features that people had argued for before but ineffectively. I.e. we've had a problem that people fail to state the need for a feature, or make the case/explain the idea poorly. E.g. force-local (absolutely crucial), A_ variables in #Include, ObjCount, new/backported A_ variables, Hotstring function, Send {Text}, see the changelogs for v.1.1.27 onwards:
Changes & New Features | AutoHotkey
https://autohotkey.com/docs/AHKL_ChangeLog.htm
- I've also written various bits of C++ code to fix things.
AutoHotkey C++ Powerhouse: Introduction - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=23&t=54394
- Some of the people here that like to comment on the AHK v2 development forum, are completely impractical, have no sense of forward-planning or prioritisation, have no sense of the user base, and just like to argue in an unnecessarily emotional/dramatic way but never do anything, and if they're so clever / so skilled in C++, why don't they ever propose any fixes? Worse, if people did act dramatically occasionally for *some* features, that would expedite their inclusion, but people have been dramatic about virtually everything.
- Another problem is users dropping poorly-explained random ideas all over the place, but not collecting the ideas in one place cf. my Wish List 2.0.
- Another problem is attacking and being condescending towards the main dev, I have one user in mind, (the situation is ludicrous when you consider the knowledge difference,) and if they don't start trying to 'play nice' with people, they could kill AHK v2, and may have already done so.
- So, I don't blame the dev, but I do blame many of the AHK v2 development forum participants for their inaction/counterproductive actions.