B
Bernie Yaeger
I'm having difficulty searching an arraylist for certain values that are in
another arraylist. Essentially, I want to load the second arraylist with
only one of each of the possible elements in the first arraylist. Thus if
singlearraylist contains "ww", "l2", "s1", "ww", "cc", "s1" I only want
marraylist to have "ww", "l2", "s1", "cc". The search seems to fail
regardless what I do, and the result is that marraylist has virtually all of
the elements from singlearraylist. Here's my code:
For i = 0 To singlearraylist.Count - 1
searchobj = singlearraylist(i)
ifind = marraylist.BinarySearch(searchobj)
If ifind < 0 Then ' ie, not found
marraylist.Add(singlearraylist(i))
End If
Next
Tx for any help.
Bernie Yaeger
another arraylist. Essentially, I want to load the second arraylist with
only one of each of the possible elements in the first arraylist. Thus if
singlearraylist contains "ww", "l2", "s1", "ww", "cc", "s1" I only want
marraylist to have "ww", "l2", "s1", "cc". The search seems to fail
regardless what I do, and the result is that marraylist has virtually all of
the elements from singlearraylist. Here's my code:
For i = 0 To singlearraylist.Count - 1
searchobj = singlearraylist(i)
ifind = marraylist.BinarySearch(searchobj)
If ifind < 0 Then ' ie, not found
marraylist.Add(singlearraylist(i))
End If
Next
Tx for any help.
Bernie Yaeger