EMS Manual

EMS Procedures
EMS Manual426909-005
15-17
EMSINIT and EMSINITMAP Procedures
RVUs or later, or it returns ZSPI^ERR^MISTKN if the event buffer contains an event
preceding the D-series RVU:
EMSGETTKN(buffer, ZEMS^TKN^D00,
d00 ); ! output
d00 is of token type ZSPI^TYP^BOOLEAN.
Usage Restrictions for Special-Operation Tokens
These restrictions apply to special-operation tokens:
In general, special operations are not defined for header tokens. However, the
ZSPI^TKN^COUNT and ZSPI^TKN^LEN special operations are defined for all
tokens (including header tokens).
Perform special operations on special-operations tokens only in these
(exceptional) cases:
To find the number of subjects in an event message, call EMSGETTKN:
EMSGETTKN(buf, ZSPI^TKN^COUNT,
ZEMS^TKN^SUBJECT, ! input
1, ! input
count ); ! output
To find the length of a particular subject in an event message, call
EMSGETTKN:
EMSGETTKN(buf, ZSPI^TKN^LEN,
ZEMS^TKN^SUBJECT, ! input
index, ! input
byte-length ); ! output
EMSINIT and EMSINITMAP Procedures
The first step in event-message creation is a call to the EMSINIT (or EMSINITMAP)
procedure. Either procedure initializes a buffer as an event-message buffer.
In TAL programs, use EMSINIT when supplying a token code for the
subject-token-id parameter. This eliminates the need to store the token code in a
temporary variable before passing it to EMSINITMAP. You must use EMSINITMAP
when supplying a token map.
Note: These procedures can be called from 32-bit and 64-bit programs.