Code: Select all
f(ByRef p:=""){
if not p ;endless loop here
p:=0
if(p++<2)
f(p)
return p
}
MsgBox % f()
Although a function may call itself recursively, if it passes one of its own local variables or non-ByRef parameters to itself ByRef, the new layer's ByRef parameter will refer to its own local variable of that name rather than the previous layer's. However, this issue does not occur when a function passes to itself a global variable, static variable, or ByRef parameter.