Thanks for your point of view.
I did it because I am always curious and wanted to try something I never did until now (i.e. working with AutoItWinSetTitle), also it was "to reduce the number of global variables"
I always smile when talking about "reducing the number of global variables" because it makes me think of mikell, each time. If you could read what he wrote to me on May 20, 2023 (I just re-read his long PM right now). He was a bit angry, since years, with this question of global variables that should be avoided etc...
As mikell is not with us any more (and I truly miss him, it's a pity he lefts us so soon because he was a great person) then I'll share a part of what he wrote to me concerning this point (the less vehement part) first in French (his [our] native language, at least Melba23, Nine and jchd will understand ) then I'll use a translator to indicate it in English :
[...] When you add '#include' at the head of the script, it amounts to adding a bunch of global variables (which are not always constants) so frankly, you really think that you are going to seriously penalize the performance of your code by adding a few?
Personally I have some doubts [...]
imho he was right. Who cares if we add a couple of global variables to our scripts, if it makes them more readable ? We shouldn't frown when a user adds a few global variables, when #include adds dozen & hundreds of them...
When I use Global variables, I like to prefix them with g_ so they're easily recognizable when reading the script later. Unfortunately I don't do it each time, that's a big mistake.