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

SPI Programming in TACL
SPI Programming Manual427506-006
8-26
#SSGETV
If the status is 0 and the get-op is token-id, the status is followed by a space and
the number of token values returned. For more information about nonzero status
codes, see Appendix A, Errors
.
Considerations
This example shows how to declare STRUCTs that allow you to extract individual
fields of the token code or the subsystem ID returned by #SSGETV with the
ZSPI^TKN^NEXTCODE or ZSPI^TKN^NEXTTOKEN option:
?SECTION decompose_ssid STRUCT
BEGIN
SSID ss;
STRUCT z^ssid REDEFINES ss;
BEGIN
CHAR z^owner(0:7);
INT z^number;
UINT z^version;
END;
END;
?SECTION nexttoken_return STRUCT
BEGIN
STRUCT tkn ; LIKE zspi^ddl^tokencode;
STRUCT ssid; LIKE decompose_ssid;
END;
?SECTION nextcode_return STRUCT
BEGIN
STRUCT tkn ; LIKE zspi^ddl^tokencode;
INT contiguous_occurences;
STRUCT ssid; LIKE decompose_ssid;
END;
This routine uses these STRUCT declarations to compare two subsystem IDs
returned by #SSGETV with ZSPI^TKN^NEXTCODE or ZSPI^TKN^NEXTTOKEN,
ignoring the version field:
?SECTION same_ssid ROUTINE == <ssid1> <ssid2>
== Returns TRUE if two SSIDs are the same except for
== the version field
#FRAME
#PUSH sstext
#DEF ss1 STRUCT LIKE decompose_ssid;
#DEF ss2 STRUCT LIKE decompose_ssid;
#IF{SINK} [#ARGUMENT/VALUE sstext/ SUBSYSTEM]
#SET ss1 [sstext]
#IF{SINK} [#ARGUMENT/VALUE sstext/ SUBSYSTEM]
#SET ss2 [sstext]
#RESULT [#COMPUTE [#COMPAREV ss1:z^ssid:z^owner(0:7)
ss2:z^ssid:z^owner(0:7)]
AND [#COMPAREV ss1:z^ssid:z^number
ss2:z^ssid:z^number] ]