6100 ADCCP Programming Manual

ADCCP Programming Example Using Transaction Application Language (TAL)
069225 Tandem Computers Incorporated B–13
CALL READUPDATE(RECFILE,RECBUFF,rec^io^size);!post another readupdate
if <> then
begin
CALL FILEINFO(recfile,ERROR);
sbuf ':=' "$RECEIVE readupdate error: " -> @ptr;
call numout(sbuf[@ptr '-' @sbuf],error,10,5);
call write(outfile,outbuf,@ptr '-' @sbuf);
if <> then call abend^;
call awaitio(outfile);
end;
if last^pid = [0,0,0] then return true; !signal system msg
return false; !signal process msg
end;
?page
!
!<<< main of next^event >>>
!
wait^loop:
fnum := -1;
call awaitio(fnum,,count^read,tag,delay);
call fileinfo(fnum,error);
if not fnum then !$receive input
if system^msg then goto wait^loop !loop on system msgs
else goto wait^loop; ! and on process msgs (unexpected)
if fnum = -1 and error = 40 then
return 2; !timed^out
If the file number is rfnum, the request must be a RECEIVETEXT or a "control” type
request like MODE SET. This example uses rfnum only to make those kinds of
requests.
if fnum = rfnum then
begin
inttag := $int(tag); !convert doubletag to integer
if inttag = 1 or inttag = 2 or inttag = 3 then
The request was a RECEIVETEXT.
begin
read^posted := false;
return 0;
end
The tag (inttag) was invalid, or the request was a "control" type request.
else return 3;
end;
If the file number is wfnum, the request must be a SENDTEXT request. This
example uses wfnum only for SENDTEXT requests.
if fnum = wfnum then
begin
!CONVERT DOUBLETAG TO INTEGER
INTTAG := $INT(TAG);
@wbuf := BUF^PTRS[INTTAG];
write^posted := false;
return 1; !frame^out
end;