Envoy Application Programming Manual

Table Of Contents
TINET Multipoint Supervisor Protocol
Envoy Application Programming Manual427159-001
8-40
Steps of Example Program
Example 8-15. Program Code for TINET Multipoint Supervisor (Page 8 of 13)
! This procedure controls each task. It is called during
! startup, once for each task, to establish each task’s data
! area. All control information pertaining to a given
! terminal is kept in this procedure’s local data area.
! Therefore, each terminal’s environment is maintained
! separately from the other’s.
!
! The basic action of this procedure is:
! 1. Write the tutorial mask to the terminal (write^line).
! 2. Call poll^line to initiate polling.
! 3. When the terminal associated with the task responds with
! data, perform credit checking (check^credit) and
! prepare the appropriate response:
!
! -If an invalid field was entered, a partial tutorial
! mask message is prepared.
!
! -If all fields are valid, then the appropriate response
! message is prepared.
! * Write the response or partial tutorial mask
! (write^line).
!
! -If a response is written, the next action is step 1.
! -If a partial tutorial mask is written, the next action
! is step 2.
!
PROC task (id);
INT id; ! address-list entry number (and task control
! block number).
BEGIN
INT l = ’L’,
s = ’S’,
.in^buffer [ 0 : in^max ],
.out^buffer [ 0 : out^max ],
count^read,
send^full^mask,
validate,
message^len;
STRING
.acctnum [ 0 : acctnum^fl - 1 ],
.banknum [ 0 : banknum^fl - 1 ],
.expdate [ 0 : expdate^fl - 1 ],
.refnum [ 0 : refnum^fl - 1 ],
.trancode [ 0 : trancode^fl - 1 ],
.amount [ 0 : amount^fl - 1 ],
.sin^buffer := @in^buffer ’<<’ 1,
.sout^buffer := @out^buffer<<1,
.message [ 0: 23 ],
.sp;