This For loop is not executed further after returning from the recursion, if the "Local n" is not directly in the loop header. Is this a bug?
Code: Select all
Function p_test()
rcl=rcl+1
DebugPrint("recursion level",rcl)
Local n
; For n=1 To 2 ; this does not work as expected
For Local n=1 To 2
If rcl=3 Then finish=True ; break at 2 recursions
If Not finish
p_test()
DebugPrint("back at level",rcl,"and n",n)
EndIf
DebugPrint(" n ",n)
Next
rcl=rcl-1
EndFunction
finish=False
p_test()