RosettaCodeData/Task/Queue-Usage/Component-Pascal/queue-usage.component
Ingy döt Net 776bba907c Sync
2013-10-27 22:24:23 +00:00

22 lines
460 B
Text

MODULE UseQueue;
IMPORT StdLog,Queue,Boxes;
PROCEDURE Do*;
VAR
q: Queue.Queue;
o: Boxes.Object;
BEGIN
q := Queue.NewQueue(6);
q.Push(Boxes.NewInteger(1));
q.Push(Boxes.NewInteger(2));
q.Push(Boxes.NewInteger(3));
o := q.Pop();
o := q.Pop();
q.Push(Boxes.NewInteger(4));
o := q.Pop();
o := q.Pop();
q.Push(Boxes.NewInteger(5));
o := q.Pop();
StdLog.String("Is empty: ");StdLog.Bool(q.IsEmpty());StdLog.Ln
END Do;
END UseQueue.