OSI/AS Management Programming Manual
Event-Retrieval Example
Sample Programs
C–36 056785 Tandem Computers Incorporated
 1 );
 IF ( SSError <> zSpi^Err^OK ) THEN CALL Debug;
 IF ( Ems^err ) THEN CALL Debug;
 -- Check for EOF warning.
 IF get^warning THEN
 RETURN;
 -- Look in GETEVENT response for a PassVal of 0.
 passval := -1;
 SSError := EmsGetTkn( Spi^Buffer,
 zEms^Tkn^PassVal,
 passval,
 1,
 ,
 zEms^Val^SSID );
 IF ( SSError <> zSpi^Err^OK ) AND
 ( SSError <> zSpi^Err^MisTkn ) THEN
 CALL Debug;
 -- Find event message within the GETEVENT response.
 tkn := zEms^Tkn^Event;
 SSError := SSGetTkn( Spi^Buffer,
 zSpi^Tkn^Addr,
 tkn,
 1,
 @event^buf );
 IF ( SSError <> zSpi^Err^OK ) THEN
 CALL Debug;
 -- Move past length part (variable-length token).
 @event^buf := @event^buf + 2D;
 -- Display the event message at your terminal.
 CALL displ^event( event^buf );
 -- Return after displaying the PASS 0 event message.
 IF passval = 0 THEN
 RETURN;
 -- Save context token from this GETEVENT response
 -- for the next GETEVENT request.
 --
 SSError := SSMoveTkn( zSpi^Tkn^Context,
 Spi^Buffer, 1, -- src.
 Spi^Buffer^Copy, 1 ); -- dest.
 IF ( SSError <> zSpi^Err^OK ) THEN
 CALL Debug;
 -- Move the updated command to Spi^Buffer for next
 -- time through the loop.
 --
 Spi^Buffer ':=' Spi^Buffer^Copy FOR $len(Spi^Buffer)
 BYTES;










