Distributed Systems Network Management (DSNM) Subsystem Interface Development Guide

DSNM Library Services
Distributed Systems Network Management (DSNM) Subsystem Interface Development
Guide109759 A-87
_POP^LM
_POP^LM
_POP^LM removes the current last member (most recently added) from a list and
returns its address. If a list is empty, _POP^LM returns _NULL.
list-member returned value
INT .EXT
is the address of the removed member.
list input
is the name of a _LIST.
length output
INT:ref
returns the length of the removed member, in bytes.
Considerations
Removing a member with _POP^LM does not immediately deallocate memory. The
removed member's memory remains allocated and its contents useable until the next
successive member is removed with _POP^LM, or a new member is added with
_PUSH^LM.
The removed member does not participate in list scans with _SUCCESSOR^LM nor
_PREDECESSOR^LM.
_PUT^LM, if used with _POP^LM, also deallocates memory for the last element
removed by _POP^LM.
Normally, a list is processed either by _PUT^LM plus _GET^LM or by _PUSH^LM
plus _POP^LM, but not both.
_UNPOP^LM replaces the last list member removed by _POP^LM.
Example
In the following example, the latest member of outlist is removed and
list^member is set to point to it:
_LIST (outlist);
INT .EXT list^member (list^member^def);
INT length;
IF _ISNULL (@list^member := _POP^LM (outlist, length));
THEN ... < list empty > ;
@list-member := _POP^LM ( list
,[ length ] );