EMS Manual

EMS Procedures
EMS Manual426909-005
15-16
EMSGET and EMSGETTKN Procedures
ZEMS^TKN^XSENDERID
Use this token code to get the node number, CPU, and PIN of the sender of the event:
EMSGETTKN(buffer, ZEMS^TKN^XSENDERID,
xsenderid ); ! output
xsenderid is of token type ZSPI^TYP^STRUCT.
ZEMS^TKN^XSENDERID-PD
Use this token code to get the process descriptor of the process that generated the
event:
EMSGETTKN(buffer, ZEMS^TKN^XSENDERID-PD,
xsenderidpd ); ! output
xsenderidpd is of token type ZSPI^TYP^STRING.
Use senderid-type tokens with EMSGET and EMSGETTKN. Using these tokens is the
only way to get information about the process that reported an event when the event-
message text was sent to $0 through a call to the WRITE procedure. By contrast, the
PROC-DESC, CPU, PIN, USERID, and NODENUM tokens do not provide information
about the process that produced the text if the event was reported by a WRITE to $0.
Instead, these tokens provide information about $0 because $0 made a tokenized
message from the text. If you use senderid-type tokens, you need not consider how
events are reported.
For more information about ZEMS^TKN^SENDERID, ZEMS^TKN^SENDERID, and
ZEMS^TKN^XSENDERID-PD, see Section 14, EMS Definitions.
ZEMS^TKN^SUBJECT.
Use this token code to get the subject token specified by index:
EMSGETTKN(buf, ZEMS^TKN^SUBJECT,
subject-token, ! output
index, ! input
subject-token-index, ! output
subject-token-ssid ); ! output
If you specify an index i, EMSGET finds the ith subject. If index is omitted or zero,
EMSGET finds the first subject beyond the current position.
EMSGET returns the token code, index, and subsystem ID of the specified subject
token. The value of the subject token is not returned. (The subject-token operation
returns all the information needed for a subsequent call to EMSGET to fetch the
subject token itself.)
ZEMS^TKN^D00.
EMSGET returns no value for this token code. Instead, EMSGET returns either a
function value of ZSPI^ERR^OK if the event buffer contains an event for D-series