Description |
Returns an IEnumerator object that allows the contents of the current Queue to be read.
A call to MoveNext must be performed before a value can be read from the enumerator - the starting position is before the first element.
|
| References | IEnumerator
|
|
Microsoft MSDN Links |
System.Collections
System.Collections.Queue
|
|
|
Geting all elements from an Queue |
program Project1;
{$APPTYPE CONSOLE}
uses
System.Collections;
var
MyQueue : System.Collections.Queue;
Enumerator : IEnumerator;
begin
// Create our queue
MyQueue := Queue.Create;
// Add entries to the queue
MyQueue.EnQueue('First');
MyQueue.EnQueue('Second');
MyQueue.Enqueue('Third');
// Display the queue
Enumerator := MyQueue.GetEnumerator;
while enumerator.MoveNext do
Console.WriteLine(Enumerator.Current.ToString);
Console.Readline;
end.
| Show full unit code | First
Second
Third
|
|
|
|