Dup

SUMMARY

Dup - Number of elements on the stack that should be duplicated.

SYNTAX

Dup(<num_of_entries>);

ARGUMENTS

num_of_entries (type:integer)
Number of elements on the stack that should be duplicated. 0 does not have any effect. If 'num_of_entries' is higher than the number of stack elements all elements are duplicated.

DESCRIPTION

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

Effect
The defined number of stack elements is duplicated and put on top of the stack in the same order as the original ones.

EXAMPLES

//Stack before (4 Elements):
//"a"
//"b"
//"c"
//"d"
Dup(2);
//Stack afterwards (6 Elements):
//"a"
//"b"
//"a"
//"b"
//"c"
//"d"

//Stack before (4 Elements):
//1
//"a"
//"b"
//"c"
Dup();
//Stack afterwards (4 Elements):
//"a"
//"a"
//"b"
//"c"


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