Envoy Application Programming Manual

Table Of Contents
TINET Multipoint Supervisor Protocol
Envoy Application Programming Manual427159-001
8-41
Steps of Example Program
Example 8-15. Program Code for TINET Multipoint Supervisor (Page 9 of 13)
INT .limit[0:0]; ! used to compute task stack size.
IF start THEN
BEGIN
! calculate task stack size.
task^space := (@limit ’-’ @l) ’+’ call^space;
! calculate stack base for system calls.
system^call^base := @s + call^space;
END;
send^full^mask := 1;
WHILE 1 DO
BEGIN
IF send^full^mask THEN
BEGIN
send^full^mask := 0;
acctnum := banknum := expdate :=
refnum := trancode := amount := 0;
! format mask.
sout^buffer :=’ wtm^full -> @sp;
! send mask.
CALL write^line (id, out^buffer, @sp ’-
@sout^buffer);
END;
CALL poll^line (id, in^buffer, count^read);
validate := check^credit (in^buffer, acctnum,
banknum, expdate, refnum,
trancode, amount, message,
message^len);
IF invalid^field THEN
BEGIN ! partial write tutorial
! format beginning of buffer.
sout^buffer :=’ [ STX, w^id, w^seq, wtm^cc,
wtm^reenter^wcc ] -> @sp;
IF invalid^acctnum THEN
BEGIN
acctnum := 0;
sp ’:=’ [ wtm^acctnum^lcfl ] -> @sp;
END;
IF invalid^banknum THEN
BEGIN
banknum := 0;
sp ’:=’ [ wtm^banknum^lcfl ] -> @sp;
END;