I'm trying to use the BinarySearch method of my ArrayList.
fileHeaders, outputHeaders, and dataRecord are all ArrayLists. They were populated by doing arrList.Add(String)
so like:
Dim fileHeaders as New Arraylist
.
. fileHeaders.Add(Mid(str1, 0 2))
.
While x < fileHeaders.Count()
If outputHeaders.BinarySearch(fileHeaders(x)) <= 0 Then
dataRecord.Remove(fileHeaders(pos))
Else
pos += 1
End If
x += 1
End While
It's throwing {"At least one object must implement IComparable."} in the If statement. I read that it should be able to do strings and ints without explicitly defining anything, so what am I doing wrong?
fileHeaders, outputHeaders, and dataRecord are all ArrayLists. They were populated by doing arrList.Add(String)
so like:
Dim fileHeaders as New Arraylist
.
. fileHeaders.Add(Mid(str1, 0 2))
.
While x < fileHeaders.Count()
If outputHeaders.BinarySearch(fileHeaders(x)) <= 0 Then
dataRecord.Remove(fileHeaders(pos))
Else
pos += 1
End If
x += 1
End While
It's throwing {"At least one object must implement IComparable."} in the If statement. I read that it should be able to do strings and ints without explicitly defining anything, so what am I doing wrong?