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

24 lines
399 B
Text
Raw Permalink Normal View History

2013-10-27 22:24:23 +00:00
MODULE UseQueue;
2019-09-12 10:33:56 -07:00
IMPORT
Queue,
Boxes,
StdLog;
2013-10-27 22:24:23 +00:00
PROCEDURE Do*;
VAR
2019-09-12 10:33:56 -07:00
q: Queue.Instance;
b: Boxes.Box;
BEGIN
q := Queue.New(10);
q.Push(Boxes.NewInteger(1));
q.Push(Boxes.NewInteger(2));
q.Push(Boxes.NewInteger(3));
b := q.Pop();
b := q.Pop();
q.Push(Boxes.NewInteger(4));
b := q.Pop();
b := q.Pop();
StdLog.String("Is empty:> ");StdLog.Bool(q.IsEmpty());StdLog.Ln
2013-10-27 22:24:23 +00:00
END Do;
END UseQueue.