|
-
May 2nd, 2008, 12:24 PM
#1
Thread Starter
Addicted Member
[RESOLVED] [2005] FIFO arraylist
I need to add items to an arraylist until the count gets to, for example, 100 and then read them on a first in first out basis
Last edited by T120; May 2nd, 2008 at 12:28 PM.
Reason: Sorry - this is wrong and I don't know how ot delete it
-
May 2nd, 2008, 12:41 PM
#2
Re: [RESOLVED] [2005] FIFO arraylist
I see that you created this thread by misstake, but just for further reference, you should use a System.Collections.Generic.Queue(Of T).
-
May 2nd, 2008, 01:18 PM
#3
Re: [RESOLVED] [2005] FIFO arraylist
A queue would be the right way to go about it, but you could also use a List (of T), and just add to the end. You would then read from first to last. A queue will do more than that, because it will remove the first item each time such that the queue count will shrink each time you read it. That may be less desirable if you have any reason to maintain the list after the reading.
My usual boring signature: Nothing
 
-
May 2nd, 2008, 01:57 PM
#4
Re: [RESOLVED] [2005] FIFO arraylist
I have posted examples of queues here.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|