TACL Reference Manual
Built-In Functions and Variables
HP NonStop TACL Reference Manual—429513-018
9-142
#EMSGET Built-In Function
buffer-var
is the name of the message buffer from which information is to be taken; it must be
a writable STRUCT that has been initialized by #SSINIT.
get-op
is one of these:
token-code
directs #EMSGET to return the token value or values associated with token-
code.
If token-code is a token that marks the beginning of a list, #EMSGET selects
the list so that subsequent calls can retrieve tokens within the list. If token-
code is ZSPI^TKN^ENDLIST, #EMSGET pops out of the list.
token-code can be any of the header tokens listed under “Header Tokens
and Special Operation for #SSGET and #SSGETV” in the description of the
#SSGET built-in function. You can also supply the token
ZSPI^TKN^DEFAULT^SSID to obtain the default subsystem ID at the current
position.
ZSPI^TKN^COUNT c-token-id
directs #EMSGET to return the number of occurrences of the token specified
by the token code or the token map c-token-id, starting with the occurrence
specified by index. To count all occurrences in the list, specify an index of 1.
If c-token-id is omitted or equal to ZSPI^VAL^NULL^TOKENCODE, and
index is omitted or zero, #EMSGET counts occurrences of the current token,
including the current occurrence of that token.
ZSPI^TKN^LEN l-token-id
directs #EMSGET to return the byte length of the token specified by the token
code or token map l-token-id. This is the size of the buffer needed to
contain the stated occurrence of the token value. For variable-length token
values, this includes the two bytes required for the length word: The byte
length returned is token-value[0]+2.
If this option is omitted or l-token-id is ZSPI^VAL^NULL^TOKENCODE,
and index is omitted or zero, #EMSGET returns the length of the current
occurrence of the current token.
If l-token-id is a token map, this operation returns the length contained in
that map; the value in the buffer can be longer or shorter than this length. To
get the actual length of the token value, call #EMSGET with ZSPI^TKN^LEN
and a token code made up of ZSPI^TYP^STRUCT and the token number from
the token map. This returns the length of the value, including 2 bytes for the
length field. Subtract 2 from this result to get the length of the value itself.