For Loops in Assume-Global Functions Topic is solved
For Loops in Assume-Global Functions
In "for k, v in obj", v2 is supposed to localize k and v, which personally I think is the way to go. I was actually really surprised when I found out v1.1 didn't do this. However, "for" loops in an assume-global function still make k and v global variables. Is this the intended effect? If so, I vote to keep the behaviour consistent.
Re: For Loops in Assume-Global Functions
Perhaps I'm mistaken and they do perform the same... I thought I tested it and saw that k and v didn't show up on the global variables list when a for loop is used in the main script body, but it looks like I was wrong...
Re: For Loops in Assume-Global Functions Topic is solved
The word localize might have been used in the docs at some point, I can't find it now. There shouldn't be any confusion now,In "for k, v in obj", v2 is supposed to localize k and v
It works.When the loop breaks or completes, these variables are restored to their former values.
You should use local appropriately, as you do for any other variables.
Cheers.
Return to “AutoHotkey Development”
Who is online
Users browsing this forum: No registered users and 40 guests