Loading...
 

Push

Push

Push(stmtName)

modern spelling is 170276 (stmntName)

parameters: Name of a statement

Stack
Stack Position Description
Stack(In) Top -
Stack(Out) Top an instruction

Push brings the instruction specified in the parameter onto the stack, in order to then assign it to a variable, for example. This only works for non-primitive statements defined with Define. This statement can then be executed at a later time using Execute.

This allows you to assign different macros to one and the same variable under different conditions and then have these macros executed with only this one variable at a later time using Execute.

Example

// Define the macro, which will be pushed into the variable writeProtocolMacro later

Define(WriteSWProtocol)
  CX_ALLOCATION_TXN stockTxnItem Inherited if { WriteBOMProtocol return }
  -> errText
  Depth ifnot { "" Drop 0 }
  -> errorID

  predecessor errText errorID stockTxnItem WriteErrorWrapper
;

 

...

// If the direction of booking is forward, get the complete define string of the macro into the variable

directionloadSalesDeliveryNoteItem 0 > if Push(WriteSWProtocol) else NULL -> writeProtocolMacro

...

// now, check if the variable writeProtocolMacro is set. If, execute the string!

costAccount ifnot
{
  3 "Fehler: Weder Kostenträger/stelle noch Vorgänger" writeProtocolMacro Dup if Execute else { Drop(3) }
  FALSE return
}

 

See also Functional Programming.

Obsolete : At that time the Push command was also used for SetFormat instructions. Today this is done by calling "call

Old:

[ "CX_CLASS::" Push(GetCollapseBitmap) COLUMN 0 ] SetFormat(, ListBox)

New:

[ "CX_CLASS::call(GetCollapseBitmap)" COLUMN 0 ] SetFormat(, ListBox)