Put
Put(access expression), Put, Put(STACK)
Parameter: an access printout
Stack | Position | Description |
---|---|---|
Stack(In) | Top | Target object |
Top 1 | a value | |
Stack(Out) | Top | - |
If an elementary data member is reached via the access expression, the value is entered into the data member.
A new slot is created if necessary. If the data member is an object, the following cases are possible:
value from the stack:
Value from Stack Top -1 | Allocation | Example |
---|---|---|
one object | Transfer to the target object with virtual Function Assign | Automatisches Anlegen eines persistenten Objektes (Datum) am übergebenen Objekt |
a string | Import into the target object with virtual Function ViewImport | Einfaches Speichern eines Strings |
a string and target object CX_FORMULA | The string is imported as a formula, analysed and converted to the internal representation (IPN) | Erstellen eines Formelobjektes und Zuweisen der Formel |
a string and target object CX_CONDITIONED_BAG | Speichern von Spalten in bedingten Tabellen (Spalten durch Kommata getrennt) |
Put without operand 'writes' the value of Stack-Top-1 according to the table above directly into the object lying on the stack-top.
Note: A transaction starts with a persistent object.
Attention: When putting on CX_NUMERIC and CX_VALUE you have to consider how the precision affects the import.
Note: Since no flags can be passed in Put to control the import, classes whose import can be controlled by flags offer corresponding Set... methods to enable the import with flags anyway.
Ex: SetValue, SetNumeric, SetTime, ...
Put(access expression, OVERWRITE), Put(STACK, OVERWRITE)
Parameter: an access expression, keyword OVERWRITE
Stack | Position | Description |
---|---|---|
Stack(In) | Top | Target object |
Top 1 | a value | |
Stack(Out) | Top | - |
If the target object is an object of class CX_OVERWRITING_REF (or derived from it), data of the original object can be overwritten with the access expression. Without the OVERWRITE parameter, data is only written if the data to be written differs from that of the original object. With parameter OVERWRITE, data is always written, even if an identical copy of the data element is created in the "wrapper".
Put(STACK), Put(STACK, OVERWRITE)
Stack | Position | Description |
---|---|---|
Stack(In) | Top | an access expression as a character string |
Target object | ||
Top 1 | a value | |
Stack(Out) | Top | - |
This form of the Put statement is useful when working with a variable access expression.