Envoy Application Programming Manual

Table Of Contents
BISYNC Multipoint Tributary Protocol
Envoy Application Programming Manual427159-001
5-42
Programming Examples
Example 5-15. Program Code for BISYNC Multipoint Tributary (Page 3 of 7)
INT PROC check^term;
BEGIN
INT error;
CALL AWAITIO (termfnum,,termlen,,0D); ! check for
! completion.
IF = THEN RETURN 1; ! completion.
IF > THEN RETURN 2; ! end of file.
! else error.
CALL FILEINFO (termfnum,error);
IF error = 40 THEN RETURN 0; ! no completion.
RETURN IF FILEERROR (termfnum) THEN 3 ! retry.
ELSE 4; ! fatal error.
END; ! check^term.
! This procedure writes the incoming message on the terminal.
! The message is displayed in the following form:
!
! FROM <s>: <text>
PROC write^term (source, array, length);
INT source, length;
STRING .array;
BEGIN
INT done,
.buf[0:66];
STRING .s,
.sbuf := @buf ’<<’ 1;