Swap
Swap
Stack | Position | Beschreibung |
---|---|---|
Stack(In) | Top | a |
Top-1 | b | |
Stack(Out) | Top | b |
Top-1 | a |
vertauscht die beiden auf Stack-Top und Stack-Top-1 liegenden Werte.
Beispiel:
// Put the object on the
stack und duplicate it. The stack is now: object object
// Copy the approved date of the stack top object and check if it is there. Leave result on stack
Copy(approved.date) if 1 else 0
// The stack is now: object 0
// Now bring the object on the stack top to check the next date:
Swap
// The stack is now: 0 object
// Check the released date and leave the result on stack again
Copy(released.date) if 1 else 0
// The stack is now: 0 0
// Compare with OR operand and show attention, if no date was found:
| ifnot { T("Objekt nicht freigegeben!", "Object not released yet!") Attention(AbortTXN) cancel
object Dup
// Copy the approved date of the stack top object and check if it is there. Leave result on stack
Copy(approved.date) if 1 else 0
// The stack is now: object 0
// Now bring the object on the stack top to check the next date:
Swap
// The stack is now: 0 object
// Check the released date and leave the result on stack again
Copy(released.date) if 1 else 0
// The stack is now: 0 0
// Compare with OR operand and show attention, if no date was found:
| ifnot { T("Objekt nicht freigegeben!", "Object not released yet!") Attention(AbortTXN) cancel