Using SPI
Using Programmatic Interfaces
107365 Tandem Computers Incorporated
7–11
Figure 7-2. Displaying the EMS Log (Page 2 of 2)
== Send the request (the open was waited, so we do not need
== to wait for the variable to become empty.)
#APPENDV request spi_buf
== Retrieve the results
#EXTRACTV reply spi_buf
[#IF NOT [#EMPTYV io_err] |THEN|
#OUTPUT *** Error [io_err] sending to $0.#ZSPI
#UNFRAME
#RETURN
]
== Close SPI
#SET err [#REQUESTER CLOSE request]
[#IF err |THEN|
#OUTPUT *** Error [err] closing $0.#ZSPI
#UNFRAME
#RETURN
]
== Retrieve the return code and place it into the SPI buffer
#SETMANY err _ retcode , [#SSGET /INDEX 1/ spi_buf
ZSPI^TKN^RETCODE]
[#IF err |THEN|
#OUTPUT *** Error [err] from #SSGET ZSPI^TKN^RETCODE
#UNFRAME
#RETURN
]
== Retrieve EMS status information and place it into the SPI
== buffer
#SETMANY err _ , [#SSGETV /INDEX 1/ spi_buf
ZEMS^MAP^COL^STATUS
ZEMS^DDL^COL^STATUS]
[#IF err |THEN|
#OUTPUT *** Error [err] from #SSGETV ZEMS^MAP^COL^STATUS
#UNFRAME
#RETURN
|ELSE|
== Retrieve the time argument (without checking contents)
#SET rslt [#ARGUMENT /TEXT arg/ WORD END]
== Call EMSDIST
emsdist logfile &
[ZEMS^DDL^COL^STATUS:ZCOL^CURRENTFILENAME], &
[#IF NOT [#EMPTY [arg]] |THEN| time [arg], ] &
type printing, textout [#MYTERM]
]
#UNFRAME