TACL Reference Manual

Built-In Functions and Variables
HP NonStop TACL Reference Manual429513-018
9-143
#EMSGET Built-In Function
ZSPI^TKN^NEXTCODE
directs #EMSGET to return the next token code that is different from the
current token code, followed by the subsystem ID. The subsystem ID returned
in the result always has a version field of zero (null).
The index parameter has no effect on this operation, but if you supply it, it must
be zero.
ZSPI^TKN^NEXTTOKEN
directs #EMSGET to return the next token code, followed by the subsystem ID.
The subsystem ID returned always has a version field of zero (null).
This operation differs from ZSPI^TKN^NEXTCODE in that it always returns the
token code of the next token, whether it is the same as that of the current
token or different, and whether the token is within a list or not. The operation
returns multiple occurrences of the same token code in the same order as they
were added to the buffer with #SSPUT(V).
The index and count parameters have no effect on this operation, but if you
use them, index must be zero; count is always returned as 1.
ZSPI^TKN^OFFSET o-token-id
directs #EMSGET to return the byte offset of the token specified by the token
code or token map o-token-id. The value returned is the offset from the
start of the buffer to the value associated with the specified token code and
index. (For variable-length values, the token value begins with the length word;
the offset given is the offset to that length word.)
If you omit this option or if o-token-id is equal to
ZSPI^VAL^NULL^TOKENCODE, and index is omitted or zero, #EMSGET
returns the length of the current occurrence of the current token.
You must supply appropriate token code definitions. TACL supports the special
semantics for only those SPI special token codes shown; any other token
codes are assumed to adhere to standard semantics.
Result
#EMSGET returns a numeric status code indicating the outcome of the SSGET
procedure.
Note. The special operations ZSPI^TKN^NEXTCODE and ZSPI^TKN^NEXTTOKEN
return only token codes. In particular, note that tokens added to the buffer using
#SSPUTV with a token map are carried in the buffer with a token code of type
ZSPI^TYP^STRUCT. The NEXTCODE and NEXTTOKEN operations return that token
code, not the token map used with #SSPUTV.