evilC wrote:Just to say that you quite possibly do not want a static var for this.
What is it that you want to toggle? If you are using another function to check the status of the toggle, you will not be able to, because it is private to the ToggleSwitch() function.
For now, I'm just using very simple menu commands in my app to be toggled. For my learning process of functions, I wanted to get just a basic toggle in a function operating first prior to adding any arguments etc.
evilC wrote:What you want is either to make toggle global, or have ToggleSwitch be a class method, and make toggle a property of the class.
Both of these help enormously! I've been trying to understand the AHK approach to Classes recently and your example cleared up many questions I had. Thanks for taking the time to post both of these examples. The knowledge acquired has been used already.
Shan