EMS Manual

EMS Procedures
EMS Manual426909-005
15-15
EMSGET and EMSGETTKN Procedures
Your program can exit the list by calling EMSGET to get the ZSPI^TKN^ENDLIST
token.
If you want the search for a token to start at the beginning of the buffer or current
list, your program must do one of:
Use EMSGET or EMSGETTKN, supplying a nonzero value for index.
Use SSPUT or SSPUTTKN, first resetting the initial position with
ZSPI^TKN^RESET^BUFFER or ZSPI^TKN^INITIAL^POSITION. For more
information, see the SPI Programming Manual.
The index and count parameters have no effect when token-id is
ZSPI^TKN^ENDLIST. But if supplied, index must be equal to 0 or 1, and count is
always returned as 1.
When you use a token map for the token-id parameter, the map can specify a
structure version that is longer or shorter than the structure contained in the buffer.
If the requested version is longer than the version in the buffer, EMSGET calls
SSNULL to set to null values any new fields that are not obtained from the buffer. If
the requested version is shorter than the one in the buffer, EMSGET returns only
the requested length.
Special Operations from SSGET and SSGETTKN
EMSGET and EMSGETTKN recognize a number of token codes that perform special
operations such as positioning within the event-message buffer. Think of these special
token codes, which are not actually present in the event-message buffer, as
commands to EMSGET and EMSGETTKN.
Most of these token codes and operations are identical to those defined for SSGET
and SSGETTKN (see the SPI Programming Manual for a description of these
operations). Some are defined only for EMSGET and EMSGETTKN.
Special Operations for EMSGET and EMSGETTKN
EMSGET and EMSGETTKN recognize these special token codes that are not
recognized by SSGET and SSGETTKN:
ZEMS^TKN^SENDERID
Use this token code to get the internal file name of the process that originated the
event message:
EMSGETTKN(buffer, ZEMS^TKN^SENDERID,
senderid ); ! output
senderid is of token type ZSPI^TYP^FNAME32.