Loading...
 

Copy

Copy

Copy(access print), Copy(access print, ENUM), Copy, Copy(STACK), Copy(STACK , ENUM)

Parameters: an access expression, transformation flag

Stack
Stack Description
Stack(In) one object
Stack(Out) Copy of the selected data member

Copy delivers the copy of a data field reached via the access printout. An error message appears if the access printout leads to a non-existent data field. If the access printout cannot be followed up because of

  • of a pointer with value = NULL,
  • a function that returns NULL,
  • of a slot not available in the object,

this is how Copy INVALID brings INVALID onto the stack.

Note: Copy can access elementary data types, objects and references, but not collections.

If Copy meets a reference, it is dereferenced; a copy of the referenced object is obtained.

If the access expression is missing, you get a (transient) copy of the object from the stack.

The ENUM flag can be specified when the access expression results in an element of data type ENUMSHORT or ENUMCHAR. With this flag you get the value transformed into a string (external representation), without flag ENUM you get an integer (the internal representation).

Copies created by Copy are subject to the garbage collection, this also applies to objects: If no variable or stack entry refers to the transient object anymore, InstantView® assumes that this object is no longer needed and automatically deletes it. InstantView® does not check whether the object to be deleted is referenced by another object. If this is the case, either assign both objects to variables or use the following variant

Copy(access print, KEEP), Copy(, KEEP), Copy(STACK , KEEP)

Parameter: an access expression, KEEP flag

Stack
Stack Description
Stack(In) one object
Stack(Out) Copy of the selected object

The copied object exists until it is explicitly deleted with the instruction DeleteObject.

Note:
Flag KEEP is meaningless for elementary data types.

With a persistent object, a transaction begins.