Expand Management Programming Manual

EVENT MANAGEMENT
Additional TAL Source Modules
retry:
! Prompt for and read line quality threshold
CALL WRITEREAD ( term, term^buf, text^len, 14,
input^len);
IF > THEN ! EOF from terminal
CALL STOP;
IF < THEN ! Some unusual condition
BEGIN ! Check whether to retry
IF FILEERROR ( term ) THEN GOTO retry;
CALL DEBUG;
END;
! Terminate input with a null
s^term^buf[input^len] := 0;
! Translate number to internal integer
CALL NUMIN ( S^TERM^BUF, line^quality^threshold
, 10, ERROR);
IF ( ( ERROR = 0 ) AND
( line^quality^threshold >= 0 ) ) THEN
got^it := true;
END; ! WHILE
END;
! This procedure is called when the LOW^LINE^QUALITY filter
! finds a line with line quality lower than the threshold;
! it brings down the line and generates an event message
! indicating that it has done so.
!
PROC abort^low^qual^line ( event^buf );
INT .EXT event^buf;
BEGIN
INT ldev^num; ! LDEV Number of line
STRUCT .ldev^name ( zspi^ddl^fname32^def );
INT line^qual; ! Line quality from EXPAND event
STRUCT .line^name;
BEGIN
INT len;
STRING objname [ 0:zcom^val^objname^len-1 ];
END;
STRING .text^buf := @evt^text^buf '<' 1;
STRING .eot; ! End Of Text pointer
INT collector; ! File number of EMS collector
INT event^len; ! Length of event message
8-96