RemoveLinks question

BlitzMax Forums/BlitzMax Beginners Area/RemoveLinks question

Hi, I have a piece of code which creates 3 links to 3 successive objects in a list:
firstLink=List.FirstLink() 
If firstLink Then secondLink=firstLink.NextLink() 
If secondlink Then thirdLink=secondLink.NextLink()


Using the Link.value() method, I compare variables of each object pointed to by the link.

If these variables are identical I use removelink to delete the objects from the list.

However, I assumed that when the object the link points to is deleted, then the link should automatically become NULL (as the object it points to no longer exists). However, in the debugger the pointer retains the address it was pointing to even after the removelink command has executed. Is this normal?
Thanks

Is this normal?
Yes.

;-)

But why arent the pointers null?

if you use the remove method, it automatically connects the previous and next link to guarantee the lists structure. As long as this was not the last item, then reference of the next item won't be null

I understand, thanks for the explanation