Distributed Systems Network Management (DSNM) Subsystem Interface Development Guide

_UNPOP^LM
A-132
109759Distributed Systems Network Management (DSNM) Subsystem Interface
Development Guide
DSNM Library Services
_UNPOP^LM
_UNPOP^LM replaces the last list member removed from a list using _POP^LM.
error returned value
INT
is a ZDSN^ERR value, indicating the outcome of the call. See Appendix B,
“DSNM Error Codes,for error code definitions.
list input
is the name of a _LIST.
list-member input
INT .EXT
is a pointer to the member most-recently removed from list with _POP^LM.
Specifying a list member that is not the most-recently removed with _POP^LM
invalidates the _UNPOP^LM operation. Also, any intervening _PUT^LM or
_DEALLOCATE^LIST invalidates the _UNPOP^LM operation. Results from any of
these are unpredictable.
Example
In the following example, members of worklist are examined and removed up to the
first member that does not match a particular control value:
_LIST (worklist);
INT .EXT list^member (list^member^def);
! list^member^def includes control^field
WHILE _NOTNULL (@list^member := _POP^LM (worklist))
AND list^member.control^field = current^ctl^value
DO
BEGIN
< process all list^members matching current^ctl^value>
END;
! Put non-matching list^member back
IF _NOTNULL (@list^member)
THEN IF (error := _UNPOP^LM (worklist, list^member))
THEN ... < data corrupted > ;
error := _UNPOP^LM ( list
,list-member );