Hello Andreas, I think I've found a bug in For...Next loop using recursive functions, the following piece of code render an object and check if exists object's childs, if so renders them calling recursively the RenderObject() function:
Code: Select all
Function scui.RenderObject(id)
...
; RENDER ALL CHILDS -----------------------------------------------
If helpers.FieldIsNil(Obj, "childlist") = 0
Local cnt
Local childs = helpers.CountEntries(Obj.ChildList)
DebugPrint("RENDERING CHILDS OF ", Obj.oName)
For cnt = 1 To childs
DebugPrint("- Child ", scui.IFO[Obj.ChildList[cnt].Id].oName)
scui.RenderObject(Obj.ChildList[cnt].Id)
Next
EndIf
...
EndFunction
Instead, using a While...Wend loop, works correctly:
Code: Select all
Function scui.RenderObject(id)
...
; RENDER ALL CHILDS -----------------------------------------------
If helpers.FieldIsNil(Obj, "childlist") = 0
Local cnt = 1
Local childs = helpers.CountEntries(Obj.ChildList)
DebugPrint("RENDERING CHILDS OF ", Obj.oName)
While cnt <= childs
;For cnt = 1 To childs
DebugPrint("- Child ", scui.IFO[Obj.ChildList[cnt].Id].oName)
scui.RenderObject(Obj.ChildList[cnt].Id)
cnt = cnt + 1
;Next
Wend
EndIf
...
EndFunction
Regards, Fabio