I'm not sure if this is well known or not it is possible to have a static variable in a function.
To do so use a Global.
i.e.
Running the above example will print 5 instead of 1 as it would if a local variable were to be used in stead.
Cheers.
To do so use a Global.
i.e.
strict Function MyTest(flag : int = 0) global static : int if flag = 0 static:+1 else print static end if end function for local i : int = 0 to 4 MyTest() next MyTest(1) End
Running the above example will print 5 instead of 1 as it would if a local variable were to be used in stead.
Cheers.