Clone: IQueue;
The Clone method creates a copy of the queue.
Sub Main;
Var
Que, Que1: IQueue;
i: Integer;
Begin
Que:=New Queue.Create;
Que1:=New Queue.Create;
For i:=0 To Math.RandBetweenI(50,100) Do
Que.Enqueue("Value "+Math.RandBetweenI(0,100).ToString);
End For;
Que1:=Que.Clone;
Que.Clear;
End Sub Main;
After executing the example the Que1 queue contains a copy of the Que queue.
See also: