RosettaCodeData/Task/Queue-Usage/Component-Pascal/queue-usage.component

23 lines
543 B
Text
Raw Normal View History

2013-10-27 22:24:23 +00:00
MODULE UseQueue;
IMPORT StdLog,Queue,Boxes;
PROCEDURE Do*;
VAR
2014-01-17 05:32:22 +00:00
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
2013-10-27 22:24:23 +00:00
END Do;
END UseQueue.