TIP: Singleton with Autohotkey

Put simple Tips and Tricks that are not entire Tutorials in this forum
User avatar
Posts: 314
Joined: 07 Oct 2013, 04:05
GitHub: hoppfrosch
Location: Rhine-Maine-Area, Hesse, Germany

TIP: Singleton with Autohotkey

25 Nov 2016, 01:03

Hi everybody,

I just searched for a Singleton implementation with AutoHotkey and I found the following: http://www.programering.com/a/MDN4YDMwATU.html
It's quite simple, so I thought I share my finding.

Basically spoken, a Singleton is a design pattern which ensures that a class has only one instance. Most common use for a Singleton (at least for me) is as a replacement for global variables. If you want to know more about Singletons have a look at Wikipedia(or google for it).

Here's the implementation suggestion for a Singleton with AutoHotkey - All credits go to: http://www.programering.com/a/MDN4YDMwATU.html

Posts: 5706
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: TIP: Singleton with Autohotkey

25 Nov 2016, 03:31

Why don't you just use the class itself? There is no need to instantiate it or to check if it has already been instantiated, because it always exists.

Return to “Tips and Tricks”

Who is online

Users browsing this forum: No registered users and 4 guests