I'm stuck on the OnEvent method in a loop. A part of my script is as follows:
Code: Select all
loop read, "button.txt"
{
Name := (StrSplit(A_LoopReadLine, ","))[1]
Posit := (StrSplit(A_LoopReadLine, ","))[2]
Entry.Add("Button", Posit, Name).OnEvent("Click", (*) => Handle(Name))
}
I thought it is because the variable Name is a string and thus is only referenced. But it is the same when variable Name is a just a number.
I guess the parameters of the function Handle are all stored as a reference.
Can anyone provide a suggestion on this?
I'm not a native English speaker, so if there is anything inappropriate in the language, please forgive me.
Thanks
Oswald