Stack Handling and Saving Script
Webb - all rights reserved - ©2004
Author - Jann Scheuer

Summary: Manipulates stack and saves up to 21 stack items in memory

Instructions: The application manipulates the rpn stack and saves an
rpn stack of up to 21 items in memory.
Dn, Up - scrolls stack items back and forth between saved stack and rpn
stack. (Items are deleted from rpn and saved stack respectively.)
Ld - puts (loads) rpn stack on top of saved stack.
Sh - puts saved stack on top of rpn stack. Items are not deleted from
saved stack. This allows you to keep a copy of a stack of up to 21 items
in memory.
R+ - rotates rpn stack.
R- - rotates rpn stack backwards.
Srt - sorts rpn stack in ascending order. (slow)
Rev - reverses order of items in rpn stack.
Gt - gets value of tos'th rpn stack item.
Pt - puts nos in tos'th rpn stack item.
Sp - swaps nos'th and tos'th stack item.
Mn - Menu:
  Hs - shows heigth of rpn stack.
  # - shows heigth of saved stack.
  Cls - clears rpn stack.
  Clm - clears saved stack.
  Ran - puts tos randomized items between +nos and -nos on top of rpn

Stack indexes for Gt, Pt and Sp refer to the rpn stack before(!) function
values are put on the stack.
Some functions do not work for rpn stacks of more than 37 items.


"Dn: Tos to memory"
"Up: Memory to tos"
"Ld: Load stack into memory" {xv#'21'<(xv1+XvxvX@:B)h!(B)};
"Sh: Show memory" xv!(.)xvV{vx@v1-Vv1<(B)};
"R-: Rotate backwards"hk@;
"R+: Rotate"hr@;
"Srt: Sort stack"
"Rev: Reverse stack"
"Gt: Get (tos)"g@;
"Pt: Put nos in (tos)"1+p@;
"Sp: Swap (tos) and (nos)" XyXzxyg@Xwxzg@Xx
"Mn: Misc."D'Height of stack, # saved, clear \stack, clear memory,