==== STKPUSH ====
----
----
Push a snapshot of the current stack on the Undo stack
----
^ __Input Stack__ ^ ^ __Output Stack__ ^
| | **→** | |
| //Level 1// | //→// | //Level 1// |
{{page>manual:chapter6:aux:legend&nofooter&noeditbtn&inline}}
|**Type**| [[manual:chapter5:basics#commands|Command]] ||
|**Parallel list processing**| [[manual:chapter5:listproc#group-1commands-that-cannot-parallel-process|Group 1]] ||
|**Affected by flags**| None ||
----
The ''STKPUSH'' command creates a snapshot of the stack and pushes it on the top of the Undo stack. The Undo stack may contain up to 8 snapshots: each time a ninth is pushed on it, the snapshot on level 8 is lost.
The command has little utility in interactive mode, since each time a command is typed and ''[[manual:chapter6:operators:cmd_ovr_xeq|XEQ]]''ted a snapshot of the stack is already pushed on the Undo stack: the only effect of ''STKPUSH'' would be to duplicate the latest snapshot.
----
This command is new in newRPL and does not exist in userRPL.
----
The following program
« 123
456
789
STKPUSH
CLEAR
»
leaves an empty stack. If **LF** is pressed, the previous stack will be restored.
3: 123
2: 456
1: 789
……………………………………………………………………………………
----
{{page>manual:chapter6:stack&nofooter&noeditbtn&inline}}