Code: Select all
test()
test() ;____________________ function _________________
{
static x := A_ThisFunc
msgbox, % x
}
Code: Select all
test()
test() ;____________________ function _________________
{
static x := A_ThisFunc
msgbox, % x
}
But expressions in static variables are looked-up much sooner, before any function can be executed:A_ThisFunc
The name of the user-defined function that is currently executing (blank if none)
(https://autohotkey.com/docs/Functions.htm#static)Static var := expression is supported. All such expressions are evaluated immediately before the script's auto-execute section in the order they are encountered in the script.