Try OpenEdge Now
skip to main content
ABL Reference
Handle Attributes and Methods Reference : LAST-OBJECT attribute
 

LAST-OBJECT attribute

The object reference for the last class instance in the list of all valid ABL and .NET class instances created in the current ABL session. If there are no class instances in the current session, this attribute returns the Unknown value (?).
Data type: Progress.Lang.Object
Access: Read-only
Applies to: SESSION system handle
Once you get the last object reference in the list, you can use the PREV-SIBLING property in the Progress.Lang.Object class to get the previous entry in the list of ABL and .NET object references.
There are two points worth noting about this attribute with garbage collection enabled:
*The object references maintained by the LAST-OBJECT attribute and the PREV-SIBLING property do not count as references for garbage collection. That is, if a class instance is referenced only on the session object chain, it is available for automatic garbage collection.
*When an ABL object that inherits from a .NET object is on the session object chain, it can have circular references that prevent it from being deleted (as with pure ABL objects). When there are no more ABL references to such an ABL-derived .NET object, the object is removed from the object chain, but may still be instantiated because of references to it from .NET. If the application re-obtains a reference to the object in ABL by getting it from .NET, the reference is again placed on the object chain.
Note: To obtain the last .NET form or ABL FormProxy object in the list of all valid form objects created in the current ABL session, use the LAST-FORM attribute.

See also

FIRST-OBJECT attribute, LAST-FORM attribute, PREV-SIBLING property, Progress.Lang.Object class