6100 ADCCP Programming Manual

ADCCP Programming Example Using Transaction Application Language (TAL)
B–14 069225 Tandem Computers Incorporated
If the file number is asynfnum, an asynchronous read completed. The program
prints the asynchronous message on the home terminal.
if fnum = asynfnum and count^trans > 0 then
begin
sbuf ':=' "ASYNC RESPONSE:" -> @ptr;
call write(outfile,outbuf,@ptr '-' @sbuf);
call awaitio(outfile);
if <> then call abend^;
call sblank(rbuf,30);
After an asynchronous read completes, the program issues another one to be sure
there is always a READ outstanding.
call read(asynfnum,rbuf,$LEN(d.command^response));
goto wait^loop;
end !end of then loop
else call debug;
end;
This procedure opens the ADCCP line.
?PAGE "OPEN LINE PROCEDURE"
Proc open^line;
begin
int type,
reclnth;
These lines ensure that the infile in the startup message is actually a 6100 ADCCP
line.
call deviceinfo(startup^msg.infile,type,reclnth);
if type.<4:9> <> 51 or type.<10:15> <> 0 then
begin
@ptr := @startup^msg.infile '<<' 1;
sbuf ':=' ptr for 9 -> @ptr;
if not type then
ptr ':=' "is not defined." -> @ptr
else ptr ':=' "is not a 6100 ADCCP line." -> @ptr;
call write(outfile,outbuf,@ptr '-' @sbuf);
call awaitio(outfile);
call abend^;
end;
sbuf ':=' "OPEN ERROR " -> @ptr;
call open(startup^msg.infile,rfnum,14); !read unit
The first OPEN, rfnum, will be used mainly for RECEIVETEXT requests.
if <> then
begin
call fileinfo(rfnum,error);
call numout(ptr,error,10,3);
ptr[3] ':=' " on 1st open." -> @ptr;
call write(outfile,outbuf,@ptr '-' @sbuf);
call awaitio(outfile);
call abend^;
end
else
begin
call setmode(rfnum,30,1);
end;