List Object Problem

BlitzMax Forums/BlitzMax Beginners Area/List Object Problem

Ok I have worked around the problem now with the following code. Its not ideal but It does the same thing. Thanks for all of your help.

Type Window
    Global WindowList:TList
	
    Method New()
        If WindowList = Null Then
	    WindowList = New TList
	EndIf
	    WindowList.AddLast Self
    End Method
	
    Function Create:Window()
        Local win:Window = New Window
	Return win
    End Function
	
    Function Update()
	If WindowList = Null Then Return
		
	' Update window orders
		
	If TmpWindowList:TList <> Null Then TmpWindowList:TList = Null
	TmpWindowList:TList = WindowList.Copy()
		
	win:Window = Window(TmpWindowList.Last())
	While win <> Null
	    ' Update / draw window
			
	    TmpLink:TLink = WindowList.LastLink()
	    WindowList.InsertBeforeLink(win,TmpLink)
	
	    TmpWindowList.Remove(win)
			
	    If Not TmpWindowList.IsEmpty()
		win:Window = Window(TmpWindowList.Last())
	    Else
		win = Null
	    EndIf
	Wend
    End Function
End Type