OSI/TS Management Programming Manual
Sample Programs
056786 Tandem Computers Incorporated C–23
retry1:
 CALL WRITE (term^file^num,
 evt^text^buf[i*evt^text^len/2],
 actual^len[i]);
 IF <> THEN
 BEGIN
 IF FILEERROR(term^file^num) THEN
 GOTO retry1;
 CALL DEBUG;
 END;
 END;
 END;
END;
?PAGE
! ***********************************************************
! * getevent^loop *
! ***********************************************************
! This procedure consists of a loop to retrieve event
! messages. Each time through the loop, the procedure
! gets an event message and calls displ^event to display
! it at your terminal. The procedure returns in the
! following cases:
!
! (1) The GETEVENT response contains a ZEMS^TKN^PASSVAL of 0
! (from a PASS 0 filter statement),
! (2) The GETEVENT response contains an EOF warning, or
! the message-processed limit (msglimit) is exceeded.
PROC getevent^loop;
BEGIN
 INT .EXT event^buf(zems^ddl^msg^buffer^def);
 INT(32) tkn;
 INT ivalue;
 ! Initialize spi^buf for GETEVENT command.
 spi^err := SSINIT(spi^buf, ZEMS^VAL^BUFLEN,
 zems^val^ssid, ZSPI^VAL^CMDHDR,
 ZEMS^CMD^GETEVENT);
 IF spi^err <> ZSPI^ERR^OK THEN
 CALL DEBUG;
 ! Save the original command.
 sav^buf ':=' spi^buf FOR $LEN(sav^buf) BYTES;
 ! Begin a loop that gets and displays event messages.
 WHILE msgcount < msglimit OR msglimit = 0 DO
 BEGIN
 msgcount := msgcount + 1;
 ! Send GETEVENT command to the distributor.
 CALL send^spi^cmd;
 ! Find event message within the GETEVENT response.
 tkn := ZEMS^TKN^EVENT;










