EMS Manual

Example of Retrieving Event Messages
EMS Manual426909-005
A-6
TAL Source File
?NOLIST, SOURCE MYAPTAL
?LIST
LITERAL true = 1;
LITERAL false = 0;
INT .term^name[0:11], term,
.rcv^name[0:11] := ["$RECEIVE",8*[" "]], rcv,
ct^rd, error;
INT .distr^name[0:11] := [12*[" "]], distr,
.distr^prog^file[0:11] := ["$SYSTEM SYSTEM EMSDIST "],
cpu^num, .term^buf[0:39], text^len, input^len,
spi^err, used^len, ems^err;
STRUCT startup^msg;
BEGIN
INT msgcode;
STRUCT default;
BEGIN
INT volume[0:3],
subvol[0:3];
END; -- of STRUCT
STRUCT infile;
BEGIN
INT volume[0:3],
subvol[0:3],
dname[0:3];
END; -- of STRUCT
STRUCT outfile;
BEGIN
INT volume[0:3],
subvol[0:3],
dname[0:3];
END; -- of STRUCT
INT param[0:30];
END; -- of STRUCT
STRUCT .spi^buf(zems^ddl^msg^buffer^def),
.sav^buf(zems^ddl^msg^buffer^def);
STRUCT .err^buf(zspi^ddl^error^def);
STRING .s^distr^qual := @distr^name[4] '<<' 1,
.s^term^buf := @term^buf '<<' 1, .end^of^text;
INT ibuflen := ZEMS^VAL^BUFLEN;
INT msgcount:= 0;
INT msglimit:= 0; ! 0 represents no limit, 100 is typical
LITERAL evt^text^len = 78;
LITERAL num^evt^lines = 2;
INT .evt^text^buf[0:(evt^text^len/2)*num^evt^lines];
INT .actual^len[0:num^evt^lines];