473,394 Members | 1,737 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Array List - enumeration

Please help me in the understanding functioning of an arraylist:
I've having an arraylist function level, which I'm looping another object,
and check the values of arraylist for existance with this looped object. So
i'm passing the value of this object with the arraylist in another function
(byval)and looping through the arraylist, and checking this object value.

and i've getting this message:
enumeration already finished

according to my understanding when i pass the arraylist in another function,
it is not retain the state of the iteration of last function call. and it
should start from the beginning. then why i'm getting 'enumeration already
finished'. when i can see arraylist count>0.

It seems i'm not clear about the object values passing in the function
(byval) in .net

please help in understanding the same.

Code snippnet is here

Public Function TravellerExists(ByVal arrTravellers As ArrayList, ByVal Id
As String) As Boolean
If Not arrTravellers Is Nothing Then
Dim objTraveller As OceanMsgXMLTemplates.Traveller
If arrTravellers.Count > 0 Then
For Each objTraveller In arrTravellers
If objTraveller.ID = Id Then
Return True
End If
Next
End If
End If
End Function

Thanks
Nov 22 '05 #1
1 2361
Amit Puri <tc*****@emirates.com> wrote:
Please help me in the understanding functioning of an arraylist:
I've having an arraylist function level, which I'm looping another object,
and check the values of arraylist for existance with this looped object. So
i'm passing the value of this object with the arraylist in another function
(byval)and looping through the arraylist, and checking this object value.

and i've getting this message:
enumeration already finished


It's not clear to me why you're getting that - could you post a short
but complete program which demonstrates the problem?

See http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 22 '05 #2

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

Similar topics

0
by: Row | last post by:
HI, I would first like to say its been about 3 years since looking at java im very rusty! I have to write a post it notes type applet which will function online. (reading from a flat text file)...
1
by: Row | last post by:
HI, I would first like to say its been about 3 years since looking at java im very rusty! I have to write a post it notes type applet which will function online. (reading from a flat text file) ...
13
by: hn.ft.pris | last post by:
Hi: I have the following simple program: #include<iostream> using namespace std; int main(int argc, char* argv){ const double L = 1.234; const int T = static_cast<const int>(L); int arr;
3
by: pozz | last post by:
Hi all! In source.h, I define a struct and the symbolic names of the indexes: --- source.h --- typedef struct { type field1; type field2; ... type fieldm; } mystruct;
2
by: shapper | last post by:
Hello, I have a generic list as follows: Dim categories As Generic.List(Of Enumeration.Category) Category is an enumeration as follows: Public Enum Category Book Document
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.