I initialize a static variable using a function which in turn uses a static variable. A blank is returned for the call to the function testFunc(). I appears that static variables are initialized in one pass in the order they are encountered. If I swap the position of the two functions in the example below, everything works as expected.
Relayer
Code: Select all
#SingleInstance Force
#NoEnv
Msgbox % testlib()
Msgbox % testFunc() ;returns blank
Return
testFunc()
{
static x := testlib()
Return x
}
testlib()
{
static y := 42
Return y
}
ExitApp
Escape::ExitApp