Nate Bross
Contributor
I have two collections of custom class objects like this.
Every user defined amount of time NewItems will be cleared and populated. I need to figure out if there is an item in NewItems that IS NOT in OldItems and if there is add it to a third collection.
I am trying to use the following code to check if the item is a re-occurance.
The problem is that I get three hundred of the same entery into my UnViewed collection.
If anyone could help me with the logic of this, I'd really appreciate it.
Visual Basic:
Dim NewItems as Collection
Dim OldItems as Collection
Every user defined amount of time NewItems will be cleared and populated. I need to figure out if there is an item in NewItems that IS NOT in OldItems and if there is add it to a third collection.
I am trying to use the following code to check if the item is a re-occurance.
Visual Basic:
If OldItems.Count <> 0 Then
For Each OldItem As Item In OldItems
For Each NewItem As Item In NewItems
If NewItem.ItemID() IsNot OldItem.ItemID() Then
UnViewed.Add(NewItem)
Exit For
End If
Next
Next
Else
OldItems = NewItems
End If
The problem is that I get three hundred of the same entery into my UnViewed collection.
If anyone could help me with the logic of this, I'd really appreciate it.