SPI Programming Manual (G06.24+, H06.03+, J06.03+)

SPI Programming in TACL
SPI Programming Manual427506-006
8-19
#SSGET
SPI defines a number of token codes for use with #SSPUT and #SSPUTV to set
the values of header tokens and perform special operations. See Special
Operations for #SSPUT and #SSPUTV on page 8-13.
#SSGET
Use #SSGET to retrieve binary token values from an SPI buffer, convert them to
external representation, and make that external representation accessible in the
functions expansion.
You cannot use #SSGET to extract values of extensible structured tokens using a
token map or using a token code of type ZSPI^TDT^STRUCT. For this purpose, use
#SSGETV.
option
is any of:
COUNT count
gives the maximum number of token values to return. This specifies that the
token value returned in the expansion is an array of
count elements, each of
which is described by
token-code. If not supplied, it defaults to 1.
If a
count greater than 1 is specified, #SSGET continues searching until it
either satisfies the requested count or reaches the end of the buffer or list.
A
count less than 1 causes an error.
INDEX index
if index is greater than zero, specifies an absolute index for token-code,
starting from the beginning of the buffer or list. An
index of 1 gets the first
occurrence of that token, an
index of 2 gets the second occurrence, and so
on.
if
index is zero or not specified, #SSGET returns the next occurrence of the
token following the current token, and resets the current position to the token
returned. For example, if a token occurs five times, calling #SSGET once with
index = 1 and four times with index = 0 returns all occurrences.
An
index value less than zero causes an error.
Your program must
always either supply a nonzero index or first reset the
initial position (#SSPUT or #SSPUTV with ZSPI^TKN^INITIAL^POSITION or
ZSPI^TKN^RESET^BUFFER) if the search is to start from the beginning of the
buffer (or from the beginning of the current list).
#SSGET [ / option [ , option ]... / ] buffer-var get-op