OSI/AS Management Programming Manual
Event-Retrieval Example
Sample Programs
056785 Tandem Computers Incorporated C–35
--
-- Include the EOFSTOP token, which will cause the
-- distributor to send an ZEMS^WRN^EOF token when it has
-- read all currently available event messages.
--
ivalue := zSpi^Val^True;
SSError := SSPutTkn( Spi^Buffer,
zEms^Tkn^EofStop,
ivalue );
IF ( SSError <> zSpi^Err^OK ) THEN
CALL Debug;
--
-- Save the original command.
--
Spi^Buffer^Copy ':=' Spi^Buffer FOR $len(Spi^Buffer^Copy)
BYTES;
--
-- Begin loop that gets and displays event messages.
--
WHILE msgcount < msglimit OR msglimit = 0 DO
BEGIN
msgcount := msgcount + 1;
-- How much of Spi^Buffer has been used?
SSError := SSGetTkn( Spi^Buffer,
zSpi^Tkn^UsedLen,
used^len );
IF ( SSError <> zSpi^Err^OK ) THEN
CALL Debug;
-- Send GETEVENT command to the distributor.
CALL WriteRead( Distr^Fn,
Spi^Buffer,
used^len,
zEms^Val^BufLen );
IF <> THEN
CALL Debug;
-- Reset buffer length to what you declared
-- for Spi^Buffer.
--
SSError := SSPutTkn( Spi^Buffer,
zSpi^Tkn^Reset^Buffer,
SPI^BufLen );
IF ( SSError <> zSpi^Err^OK ) THEN
CALL Debug;
--
-- Process GETEVENT response.
--
SSError := SSGetTkn( Spi^Buffer,
zSpi^Tkn^RetCode,
EMS^Err,