Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
20
Task/Queue-Definition/REXX/queue-definition.rexx
Normal file
20
Task/Queue-Definition/REXX/queue-definition.rexx
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
/*REXX program to demonstrate FIFO queue usage by some simple operations*/
|
||||
call viewQueue
|
||||
a="Fred"
|
||||
push /*puts a "null" on top of queue.*/
|
||||
push a 2 /*puts "Fred 2" on top of queue.*/
|
||||
call viewQueue
|
||||
|
||||
queue "Toft 2" /*put "Toft 2" on queue bottom.*/
|
||||
queue /*put a "null" on queue bottom.*/
|
||||
call viewQueue
|
||||
do n=1 while queued()\==0
|
||||
parse pull xxx
|
||||
say "queue entry" n': ' xxx
|
||||
end /*n*/
|
||||
call viewQueue
|
||||
exit /*stick a fork in it, we're done.*/
|
||||
/*──────────────────────────────────viewQueue subroutine────────────────*/
|
||||
viewQueue: if queued()==0 then say 'Queue is empty'
|
||||
else say 'There are' queued() 'elements in the queue'
|
||||
return
|
||||
Loading…
Add table
Add a link
Reference in a new issue