6100 ADCCP Programming Manual
ADCCP Programming Example Using Transaction Application Language (TAL)
B–30 069225 Tandem Computers Incorporated
The main procedure calls frame^out after a SENDTEXT request completes. If no
file system error occurred but the buffer containsan error code, the program checks
for a mode-setting frame received from the other station.
 subproc frame^out;
 begin
 INT .WBUF,LENGTH^FRAME,WPTR;
 if not error then
 begin
 IF NOT (D.COMMAND^RESPONSE.RSP = ltf^sendtext and
 D.COMMAND^RESPONSE.MOD = LTM^OK and
 D.COMMAND^RESPONSE.REQ^ID = ltf^sendtext)
 then BEGIN
 IF D.COMMAND^RESPONSE.RSP = LTF^SENDTEXT AND
 D.COMMAND^RESPONSE.MOD = LTM^HOST^MODESET AND
 D.COMMAND^RESPONSE.REQ^ID = LTF^SENDTEXT
 THEN GOTO FRAME^OUT^ERR
If a file-system error occurred or if the error code was not a mode-set condition, the
program reports the problem to the user and discontinues the session.
 ELSE BEGIN
 ERROR := 300;
 ERROR.<8:15> := ERROR.<8:15> + D.COMMAND^RESPONSE.MOD;
 END;
 END;
 end;
 IF ERROR THEN
 BEGIN
 sbuf[9] ':=' "WRITE ERROR: " -> @ptr;
 call write^err^msg;
 session := false;
 return;
 END
If the SENDTEXT request completed without error, the count of frames written
increases by 1.
 else begin
 records^written := records^written + 1;
 return;
 end;
 FRAME^OUT^ERR:
 @WBUF := BUF^PTRS[INTTAG];
 LENGTH^FRAME := FRAMESIZE -1;
 WPTR := 1;
 D.COMMAND^RESPONSE.TXT[1].<0:7> := 1; !STATION ID
 D.COMMAND^RESPONSE.TXT[1].<8:15> := 0; !STATION STATUS
 D.COMMAND^RESPONSE.TXT[2] := out^KEY;
If the SENDTEXT request completed with a mode-setting frame, the program issues
another SENDTEXT with the same tag as before.
 IF (LENGTH^FRAME := LENGTH^FRAME -1 ) THEN
 IF LENGTH^FRAME >= FOX^MSG^SIZE THEN
 BEGIN
 D.COMMAND^RESPONSE.TXT[WPTR+2] ':=' BROWN^FOX^MSG FOR FOX^MSG^SIZE;
 LENGTH^FRAME := LENGTH^FRAME - FOX^MSG^SIZE;
 WPTR := WPTR + 1 + FOX^MSG^SIZE;
 END
 ELSE
 D.COMMAND^RESPONSE.TXT[WPTR+2] ':=' D.COMMAND^RESPONSE.TXT[WPTR+1] FOR LENGTH^FRAME;
 CALL RECEIVE(WFNUM,,IOSIZE,0,LTF^SENDTEXT,$LEN(D.BASIC),TAG);
 WRITE^POSTED := TRUE;
 IF out^KEY := 32767 THEN










