Is there a limitation on fat arrow, which would not allow a function like (val, cnt) => var%cnt% := val to modify var1 ... var9, which are byref variables in the enclosing scope?
I've been trying to debug code, and have had success assigning to an outer scope array with identical code, so I'm guessing it's a known limitation. Correct? (Sorry if I overlooked it in the documentation.)
Discuss the future of the AutoHotkey language
4 posts • Page 1 of 1
Last edited by sirksel on 16 Nov 2018, 06:32, edited 1 time in total.
Byref or not doesn't matter.nested functions wrote:Dynamic variable references inside a nested function can resolve to variables from the outer function only if the nested function (or one of its own nested functions) also contains a non-dynamic reference to the variable.
That answers it perfectly, Helgef. I modified my thread title from "byref var" to "dynamic var" to make it more on-point with the real issue (dynamic, not byref) -- as you've helped me understand. Thanks.
Some more comments can be found here.
Who is online
Users browsing this forum: arcticir and 12 guests