6100 ADCCP Programming Manual
ADCCP Programming Example Using Transaction Application Language (TAL)
B–12 069225 Tandem Computers Incorporated
string .str; !string to be blanked
int bytes; !number of blanks
begin
if bytes then
begin
str := " ";
str[1] ':=' str for bytes-1;
end;
end; !blank proc
?page "NEXT^EVENT"
This procedure completes RECEIVETEXT and SENDTEXT requests, asynchronous
reads, and system and process messages. The delay value is supplied by the user in
the startup message. (For instance, this program does not use tags on MODE SET
requests.)
!
! NEXT^EVENT: - waits time "DELAY" for any IOs to complete;
! returns:
! 0 = read (RECEIVETEXT) complete
! 1 = write (SENDTEXT) complete
! 2 = timeout
! 3 = invalid tag or no tag on request
!
int proc next^event(delay);
int(32) delay;
begin
label wait^loop;
LITERAL STOP^MSG = -5, !process stop message code
abend^msg = -6, !process abend message code
node^change = -8, !node cpu status change msg code
CPU^UP^MSG = -3; !cpu reloaded message code
LITERAL NOT^ALLOWED = 2; !operation not allowed on this device
INT LAST^PID[0:3], !process id of requestor
MYNAME[0:3], !my process id
fnum,
. wbuf;
!
!Subproc to determine the type of $receive input.
!If the backup failed, it will be recreated.
!
int subproc system^msg;
begin
CALL LASTRECEIVE(LAST^PID); !sender's PID
CALL PROCESSINFO(MYPID,MYNAME); !my process name
IF LAST^PID <> [0,0,0] THEN !not a system message
ELSE !system message received
begin
IF (RECBUFF=STOP^MSG OR RECBUFF=abend^msg)! 1. backup process
AND (RECBUFF[1]=MYNAME FOR 3) ! stopped or abended
OR RECBUFF = CPU^UP^MSG ! 2. backup cpu up
THEN CALL CREATEBACKUP(BACKUPCPU,BACKUPCRTPID);
end;
CALL REPLY (,,,,0); !send reply: no error