I want some help.
I am trying to clear a variable, but it is not getting cleared reliably.
When I checked the details of the issue, I found that the roots of the issue is that multiple variables are being created with the same name. From the autohotkey variables log file, I find an entry for the variable like below.
variable_name[1 of 3]
So I believe I am clearing one out of these 3 variables, and I am trying to use another variable.
It doesn't make any difference even if include a global declaration at the beginning. I have not declared this variable with a local scope, but this variable is being used in different functions.
I use the below code for global declaration
global variable_name
For clearing the variable I use
Code: Select all
variable_name := ""
So, what I want is a single global variable, which retains only single value for the whole scope of the code. I think I cannot use static, since I cannot use it outside a function.
So, I want to know, why and when does autohotkey create multiple variables with same name, and how to avoid it.
Can anyone of you help me with this please.
I haven't shared the code, since it is long and complex.