Hi,
Yep, TList.Remove uses Object.Compare, which is why you're getting weird results. In fact, the version you posted doesn't delete anything because Compare never returns 0! Should it behave like this or just use '='? I'm not sure yet, but this side of things does need some work.
Anyways, the best solution is probably to store the TLink returned by TList.AddLast, and use Remove() directly on that, eg:
Field link:TLink
.
.
.
link=globallist.AddLast( self ) 'add self to globallist
.
.
.
link.Remove 'remove self from globallist
This will be fastest, and allows you to keep using Compare for sorting if you want.
Yep, TList.Remove uses Object.Compare, which is why you're getting weird results. In fact, the version you posted doesn't delete anything because Compare never returns 0! Should it behave like this or just use '='? I'm not sure yet, but this side of things does need some work.
Anyways, the best solution is probably to store the TLink returned by TList.AddLast, and use Remove() directly on that, eg:
Field link:TLink
.
.
.
link=globallist.AddLast( self ) 'add self to globallist
.
.
.
link.Remove 'remove self from globallist
This will be fastest, and allows you to keep using Compare for sorting if you want.