comparing values in ARRAYLISTS

  • Thread starter Thread starter steve
  • Start date Start date
S

steve

I need to compare the value of a field in a row on an arraylist with the value of a field on a second arraylist
I have this bit of code working for arrays but cant get it working for arraylists
The secone argument here (1) represents the second field in the row, with arraylists I get a message saying to many arguments.

Can I do this with arraylists or do I need to copy the arraylists to arrays?

Thanks
For q As Integer = 0 To 9

For j As Integer = 0 To 9



If StrArray1(q, 1) = StrArray2(j, 1) Then

count = count + 1
End If

Next
Next

From http://www.developmentnow.com/g/38_0_0_0_0_0/dotnet-languages-vb.ht

Posted via DevelopmentNow.com Group
http://www.developmentnow.com
 
hi steve, in theory you could do an arraylist of arraylists.

but... I would think twice before implementing something
like that, with quadratic complexity.

Probably there are more efficient way to organize
your class and data structures in order to avoid that.

-tom

steve ha scritto:
 
ah sei italiano :)

if you describe you original problem, perhaps I or other people here
can
be of help to reorganize your code. Keep in mind that multidimensional
arrays are quite inefficient in .NET and they can be usually replaced
with more efficient
objects based on unidimensional collections.

tommaso

stefano ha scritto:
 
Back
Top