ThePuiu Active Member Licensed User Longtime User Dec 9, 2019 #1 I have a list like this: Code: Type listObject (idValue As Int, NewVal As Object, OldVal As Object) Public listObjects As listObject Public SaveList As List I would like to delete all the items that have NewVal = OldVal as quickly as possible.
I have a list like this: Code: Type listObject (idValue As Int, NewVal As Object, OldVal As Object) Public listObjects As listObject Public SaveList As List I would like to delete all the items that have NewVal = OldVal as quickly as possible.
LucasHeer Active Member Licensed User Longtime User Dec 9, 2019 #2 Probably not the quickest way: Code: If(SaveList.IsInitialized And SaveList.Size > 0) Then For i=SaveList.Size - 1 To 0 Step -1 Dim lO As listObject = SaveList.Get(i) If(lO.NewVal = lO.OldVal) Then SaveList.RemoveAt(i) End If Next End If Upvote 0
Probably not the quickest way: Code: If(SaveList.IsInitialized And SaveList.Size > 0) Then For i=SaveList.Size - 1 To 0 Step -1 Dim lO As listObject = SaveList.Get(i) If(lO.NewVal = lO.OldVal) Then SaveList.RemoveAt(i) End If Next End If
ThePuiu Active Member Licensed User Longtime User Dec 9, 2019 #3 lucasheer said: Probably not the quickest way: Code: If(SaveList.IsInitialized And SaveList.Size > 0) Then For i=SaveList.Size - 1 To 0 Step -1 Dim lO As listObject = SaveList.Get(i) If(lO.NewVal = lO.OldVal) Then SaveList.RemoveAt(i) End If Next End If Click to expand... better than mine! Upvote 0
lucasheer said: Probably not the quickest way: Code: If(SaveList.IsInitialized And SaveList.Size > 0) Then For i=SaveList.Size - 1 To 0 Step -1 Dim lO As listObject = SaveList.Get(i) If(lO.NewVal = lO.OldVal) Then SaveList.RemoveAt(i) End If Next End If Click to expand... better than mine!
LucasHeer Active Member Licensed User Longtime User Dec 9, 2019 #4 ThePuiu said: better than mine! Click to expand... I doubt that! But thanks! Upvote 0