473,594 Members | 2,713 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

comparing values in ARRAYLISTS

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...nguages-vb.htm

Posted via DevelopmentNow. com Groups
http://www.developmentnow.com
Aug 2 '06 #1
3 3204
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:
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...nguages-vb.htm

Posted via DevelopmentNow. com Groups
http://www.developmentnow.com
Aug 2 '06 #2
grazie, ma come?

From http://www.developmentnow.com/groups...hreadid=797408

Posted via DevelopmentNow. com Groups
http://www.developmentnow.com
Aug 2 '06 #3
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 multidimensiona l
arrays are quite inefficient in .NET and they can be usually replaced
with more efficient
objects based on unidimensional collections.

tommaso

stefano ha scritto:
grazie, ma come?

From http://www.developmentnow.com/groups...hreadid=797408

Posted via DevelopmentNow. com Groups
http://www.developmentnow.com
Aug 2 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
4716
by: Jorgen Gustafsson | last post by:
Hi, im trying to write a small progam to compare data in 2 textfiles. I want to search for values that doesnt exist in File2. The result should be "3" in the example below but Im not able to do this since my program crosschecks all numbers in both files and Im getting a lot of "hits". (outer and inner while-loops) Below is an examples of the textfiles:
1
1997
by: DOTNETGUY | last post by:
Is there a way to compare the elements in two arraylists for the similiarities? I know i can do a loop and check but i was wondering if there is an easier way in .NET. Thank you.
2
2054
by: darrel | last post by:
I have two comma delimted strings that I need to compare individual values between the two. I assume the solution is likely to put them into an array? If so, do I need to loop through one, comparing the other, or is there some sort of compare function already in .net? For instance, I have these strings: str1: ,3,6,12,17, str2: ,7,8,12,
11
11409
by: John Salerno | last post by:
I'd like to compare the values in two different sets to test if any of the positions in either set share the same value (e.g., if the third element of each set is an 'a', then the test fails). I have this: def test_sets(original_set, trans_letters): for pair in zip(original_set, trans_letters): if pair == pair: return False
1
7684
by: psmahesh | last post by:
Hi folks, I am comparing two arrays and removing matches from the second array from the first array. Can someone take a look at this code below and mention if this is okay and perhaps if there is a better way to achieve it for(i=0;i<arrayA.length;i++){ for(j=0;j<arrayB.length;j++){ if(arrayA==arrayB)
1
1655
by: Adrienne Boswell | last post by:
I have a form which I am letting the user enter more than one event at a time. I need to check whether one date is less than another. If the display to date is earlier than the event date, then of course that's an error. I am getting values like: areaevent_display_from: 09/29/2006, 09/209/2006 areaevent_display_to: 09/29/2006, 08/29/2006 I could say:
0
1293
by: John Wright | last post by:
I have a datagrid that contains a list of decimal values. I want to compare the values of one datatable to the other datatable and update my data grid. For example my first datatable has the following data Sample Number Location Reading1 Reading2 Reading3 Reading4.......ReadingX 12345 1 22.3 21.2 31.5 28.3 54.2 12345 2 21.4...
5
1879
by: SneakyElf | last post by:
I need to write a function where the third parameter points to an address whose dereferenced value equals one of the array element's value, then the the function returns the index of the first matching array element. Otherwise -1 is returned. Here's what I have but I am going obviously wrong somewhere: #include <iostream> using namespace std; // This function compares values
2
1471
by: sumuka | last post by:
Hello Everyone, I'm doing a project in VB 6.0 and i've a flexgrid which contains some numerical values in it's cell now i need to compare these values present in flexgrid with the values in the backend access database table which has 2 columns RID and description. After comparing the flexgrid value with RID i need to select the rows which are similar for example i've no 8 and 24 in flexgrid now i need to compare this with access table...
0
7946
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7876
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8251
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8372
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
5739
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5408
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3859
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2385
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1478
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.