Roll

SUMMARY

Roll - The defined elements is rolled in its position on the stack.

SYNTAX

Roll(<num_of_entries>);

ARGUMENTS

num_of_entries (type:integer)
The number of elements on the stack that should be rolled. (0, 1 or -1 does not have any effect) <0 The element on the very top is moved to the defined position, the elements below are moved up. >0 The defined element is moved to the top of the stack, the n-1 elements are moved down.
If 'num_of_entries' is higher than the number of elements on the stack the result is undefined.

DESCRIPTION

Stack
  1. Missing arguments are taken from the stack.(and removed from there).
  2. The order of the defined elements on the stack is modified.
  3. The job does not have a return value

Effect
The defined elements are rolled up or down on the stack.

EXAMPLES

//Stack before (4 Elements):
//"a"
//"b"
//"c"
//"d"
Roll(3);
//Stack afterwards (4 Elements):
//"c"
//"a"
//"b"
//"d"

//Stack before (5 Elements):
//-3
//"a"
//"b"
//"c"
//"d"
Roll();
//Stack afterwards (4 Elements):
//"b"
//"c"
//"a"
//"d"


Syntax Notation
[aaa]
aaa is optional (zero or one occurences)
(aaa|bbb)
aaa exclusive or bbb
(aaa)*
aaa may occur indefinitely often or may be omitted
(aaa)+
aaa may occur indefinitely often but at least once
(aaa)m..n
aaa may occur from m to n times