11. The stack Rexx has a data stack, which is accessed via the "push", "queue" and "pull" instructions. The "pull" instruction (or in full, "parse pull") inputs data from the user as we have seen before. However, if there is some data on the stack then it will pull that instead. /* Access the Rexx stack */ queue "Hello!" parse pull a /* a contains "Hello!" */ parse pull b /* b is input from the user */ push "67890" push "12345" parse pull c /* c contains "12345" */ /* there is one item left on the stack */ The difference between "push" and "queue" is that when the items are pulled off the stack, the items which were queued appear in the same order that they were queued (FIFO, or first in, first out), and the items which were pushed appear in reverse order (LIFO, or last in, first out). If the queue contains a mixture of items which were pushed and items which were queued, then those which were pushed will always appear first. The stack may be used to communicate data between REXX programs, or between various subroutines within a REXX program (see the next section). In certain circumstances, it may also be used to communicate data between a REXX program and another program not written in REXX. On some systems, if a program finishes and returns to the operating system while there are still items on the stack, then the operating system will read and execute those items as if they had been typed on the terminal. However, on other systems the leftover items are just thrown away. Sometimes the items are even saved until the next REXX program is executed. It is good practice to ensure that the stack is empty before a program returns control to the operating system (except, of course, when the program has intentionally stacked a command for the system to execute or a string for the next program to read).