@Perturbatio the list only contain cars in that example.
@Cajun17, RemoveLast() or RemoveFirst() works. But I need to delete a specific object. Still you might be on to the problem. But this does not work either:
I loop a lists of a certain type, like cars. I find the car I want to remove by ID or health or whatever in a simple if-statement. Now I have an object from this list. I take that Object C and remove it from this List: MyList.Remove( C ). That C was <> null or the loop woudn't have looped. But the remove function tells me that object does not exsist in that list?!
There have to be some other factor. I don't know how to continue debugging this. It seems like a paradox. "Found it, but it does not exsist.."
@Cajun17, RemoveLast() or RemoveFirst() works. But I need to delete a specific object. Still you might be on to the problem. But this does not work either:
For Local NR = 1 To List.Count() Local C:Car = Car( List.ValueAtIndex(NR) ) If C = Null DebugStop() If List.Remove(C) DebugLog "Deleted!" Else DebugLog "Not Found!" NextI check the list in the debugger and it does indeed contain two of these very types, C is not null..
I loop a lists of a certain type, like cars. I find the car I want to remove by ID or health or whatever in a simple if-statement. Now I have an object from this list. I take that Object C and remove it from this List: MyList.Remove( C ). That C was <> null or the loop woudn't have looped. But the remove function tells me that object does not exsist in that list?!
There have to be some other factor. I don't know how to continue debugging this. It seems like a paradox. "Found it, but it does not exsist.."