
But as syntax sugar goes, I find it to be a sweet improvement.
AUTOHOTKEY SCITE SERIES
WinGet,Process,ProcessName,A Switch Process I've heard some folks in the AutoHotkey community refer to the new Switch–Case as "syntax sugar" - a somewhat disparaging, albeit accurate characterization, in that the same logic may be achieved with an If–Else series and a fall-through Else.
AUTOHOTKEY SCITE CODE
But before ending this article, I'm going to show a sample usage based on this previous post here at Experts Exchange:įollowing is a rewrite of the If–Else portion of that code using the new Switch–Case statements: The Default statement is not required to be last in the sequence.įor more details on its operation, see the online doc at the AutoHotkey site.Each set of Case statements ends implicitly at the next Case (or at the Default statement or the closing brace of the Switch itself).


If you are new to AutoHotkey, my Experts Exchange article will get you started with it: This article assumes that you have programming/scripting experience and are a user of the AutoHotkey language or, at the very least, interested in it.

First, let me start by saying that this is not an article to learn about the concept of Switch–Case in programming.
