comparing values in ARRAYLISTS

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
 
T

tommaso.gastaldi

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:
 
T

tommaso.gastaldi

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:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top