force GCCollect, good practice?

BlitzMax Forums/BlitzMax Beginners Area/force GCCollect, good practice?

this is slowly sinking in :)

i am trying to make a 'next level' kind of function that clears everything...pseudo code:
Type tNode

    Function createNode()
        'create the node
    end function

    Method Delete()
        self.node.remove() 'this needs to be triggered...
        Print "Deleted tNode"
    End Method

End Type

Type tNextLevel

    Method New()
        For Local tmp:tNode Var = EachIn  tNode.nodeList 'not sure how to use Var here...
            tmp = Null
        Next		
        GCCollect() 'when all nodes = Null, collect and trigger destructor...
        ClearList(tNode.nodeList)
    End Method
	
End Type

Local a:tNode = tNode.createNode()
Local tmp:tNextLevel = New tNextLevel


i am new to blitz and OOP, i have a lot of syntax errors which is why this case makes a good practice for me :)

i am curious about the Var in my eachinloop, i am trying to Null the reference tmp is pointing at, not tmp itself...when the reference is Nulled, the destructor is triggered, the 3D object is cleared and all is good...any pointers to where i am going wrong?

i realize there are many ways to do things, and that clearing the node outside of the destructor and forget about clearing references might be better...but as mentioned - this is good practice for me :)