Loading...
 

CX_TRANSACTION::Successors

CX_TRANSACTION::Successors

Description:

This function returns a collection of all successors. The predecessor chain is widely examined INTEGER elements. If the INTEGER parameter is reached or there are no further successors the element is added to the return collection (if INTEGER=0 a collection with the calling element(this) is returned.

Code example:

Define(UpdateReceivedQuantity)
Var(tmpItem, tmpReceived)
-> tmpItem
0 -> tmpReceived
tmpItem Get(Successors(99)) Dup if iterate
{
Dup Get(TopTransaction()) Drop
Dup Get(successors) Dup if Cardinality ifnot
{
Dup Get(TopTransaction()) Type CX_RECEIVING = if
Copy(delivered.quantity)
else
Copy(quantity)
Dup if
{
tmpReceived if { tmpReceived + }
-> tmpReceived
} else Drop
}
}
tmpReceived if
{ tmpReceived tmpItem Put(received.quantity) }
else
{ tmpItem DeleteSlot(received.quantity) }
DropAll tmpItem
;

Stack
Stack Position Object type Brief description
Stack(In) Top CX_TRANSACTION A transaction
Top 1 INTEGER Number of elements
Stack(Out) Top COLLECTION Successor
Function call: Call(Successors)