I've made a small executable utility in Lazarus, a free Delphi clone, to check some syntax issues:
It is a small GUI application that lets you interactively select the name of a .ahk file, which can be stored wholly or partly in an .ini file. It generates all messages at once, allowing them to save in the Clipboard.
1) It shows lines using "=" for assignment instead of ": =". AHK accept both, but I use just ":=" for assignment.
2) It shows lines using "IF" command without parentheses limiting the whole expression, even though in some cases the AHK allows.
3) It shows lines using where the programmer uses a command on the same line than "IF". AHK does not accept it, but it does not show the error.
4) It shows lines with "LOOP" command that is not followed by digit, "%" or '{'. It not accepts ","
If anyone is interested, Let me know.
Syntax Check Utility
-
- Posts: 13
- Joined: 27 Feb 2016, 22:14
-
- Posts: 13
- Joined: 27 Feb 2016, 22:14
Re: Syntax Check Utility
I've made a new version of this small utility, scanning commands such as IF, WHILE, LOOP and FOR; searching for block evidence (2 first lines after flow control command with the same indentation), but without using braces ({}).
This is not detected, but from the second line forward, it will run, but not linked with that flow control command.
TAB size can be set in the INI file.
This is not detected, but from the second line forward, it will run, but not linked with that flow control command.
TAB size can be set in the INI file.
Re: Syntax Check Utility
This utility sounds great -- is it available for download anywhere?
-
- Posts: 13
- Joined: 27 Feb 2016, 22:14
Re: Syntax Check Utility
Yes, you can download it at http://www.greatsolutions.com.br/soft/checkahk.exe
Re: Syntax Check Utility
paulobuchsbaum, Thanks very much for making your script checking tool available. I've come back to AHK after not having the need for it for a few years and your utility will be helpful without a doubt. Great job..
Re: Syntax Check Utility
I presume this is for V1. I’m on a Mac and would love to be able to check AHK scripts before testing on a PC at another site. Is the source available so I could build a MacOS version?
Re: Syntax Check Utility
AutoHotkey should run on MacOS via Wine, at least well enough to validate the syntax of a script. Other than that, I run a hosted version of AHK+Wine that you can access on the Wiki https://autohotkey.wiki/cloudahk which should be able to tell you if your script has syntax errors.
Return to “Other Utilities & Resources”
Who is online
Users browsing this forum: No registered users and 18 guests