Switch/Case in place of If

Suggestions, feature requests and bug reports.
Post Reply
procrastinator
Posts: 15
Joined: Apr 1st, ’20, 22:16

Post by procrastinator » Oct 22nd, ’21, 19:41

I have written an AHK script which uses "switch" to select an action in each of several different cases. It works fine if I set it up with a hotkey and run it as an AHK script sitting in the tray.

I use Fastkeys (among other things) to keep my hotkeys together so want to run this AHK script through Fastkeys but this is not possible since my copy of Fastkeys (v5.05) does not recognise the "switch" keyword and throws a wobbly, even if only asked to run the script from an external file.

I know I could re-program the script to use "If" statements but it makes the scripts less readable. The Switch/Case utility has been available in AHK 1 for some time now. Is it possible to implement it in Fastkeys please.
User avatar
Marko
Posts: 1718
Joined: Mar 2nd, ’13, 21:02

Post by Marko » Oct 25th, ’21, 21:20

Thanks, it is planned to enable this new AutoHotkey command in FastKeys by an engine upgrade, probably with one of the next version releases.
procrastinator
Posts: 15
Joined: Apr 1st, ’20, 22:16

Post by procrastinator » Oct 27th, ’21, 22:27

Thanks Marko. Very helpful.
Post Reply