Envoy Application Programming Manual

Table Of Contents
BISYNC Centralized Multipoint Supervisor Protocol
Envoy Application Programming Manual427159-001
4-53
Programming Examples
Example 4-20. Program Code for Poll and Select Procedures (Page 5 of 7)
BEGIN
! put select list entry number into MCW.
linebuf := poll^count + array.<12:15>;
! format the message.
slinebuf[2] ':=' [ DLE, STX ] -> @s;
s := source.<8:15>;
s[1] ':=' array FOR length & [ETX] -> @s;
! send the message.
CALL WRITE (linefnum, linebuf, @s '-' @slinebuf);
IF <> THEN CALL CONTROL (linefnum,13);
! clear the line.
END;
END; ! select.
! This procedure issues a nowait READ on the home terminal
! and then polls the line. If a station responds to the poll
! the message is accepted, then sent to its destination. If
! the READ on the home completes, a message is sent to the
! destination station.
!
! The command format from the terminal is:
!
! <d>,<text>
!
! <d> = destination {S,0:3}, <text> is message to be sent.
PROC doit;
BEGIN
INT done,
no^responder;
done := 0;
WHILE NOT done DO
BEGIN
term^done := 0;
termbuf := "? ";
CALL WRITEREAD (termfnum,termbuf,1,132);
no^responder := 1;
WHILE no^responder DO