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

SPI Programming in TACL
SPI Programming Manual427506-006
8-8
Setting Reset Values
Setting Reset Values
Some subsystems, such as Pathway, define special values (similar to null values) that,
when assigned to structured-token fields that represent command parameters, direct
the subsystem to reset those parameters to their default values. However, these
values might not always be legitimate values for the field as defined in TACL.
To circumvent this problem, use the TACL built-in #SETBYTES to set these fields. To
use #SETBYTES, you first define a STRUCT, then put the reset value into the
STRUCT; then you call #SETBYTES, referring to the field you are resetting and the
name of the STRUCT.
For example, suppose that you are using Pathway and want to set the subfield
ZINSPECTFILE of the field ZINSPECTINFO of the structure ZPWY^DDL^DEF^TERM.
This field is of type FNAME32, and the corresponding reset constant,
ZPWY^VAL^RESETALPHABYTE, is not compatible with FNAME32 in TACL. To set
the field to its reset value, you can use this TACL code:
[#DEF reset^alpha^byte STRUCT
BEGIN BYTE reset^alpha
VALUE [zpwy^val^resetalphabyte]; END;]
[#SETBYTES zpwy^ddl^def^term:zinspectinfo:zinspectfile
reset^alpha^byte]
For comparisons involving such values, use the #COMPAREV built-in.
Syntax of the TACL Built-Ins
These built-in functions are the TACL counterparts of the SPI procedures described in
Section 3, The SPI Procedures
. (They call the SPI procedures internally.)
#SSINIT
Use #SSINIT to initialize a STRUCT as an SPI buffer, preparing it for use with the
other #SS
xxx built-in functions. This operation gives the buffer an appropriate header
and, optionally, adds parameter information.
Built-In Page
#SSINIT
8-8
#SSNULL 8-10
#SSPUT 8-11
#SSPUTV 8-16
#SSGET 8-19
#SSGETV 8-24
#SSMOVE 8-27