Guardian Programmer's Guide

Table Of Contents
Communicating With a TACL Process
Guardian Programmer’s Guide 421922-014
8 - 17
Reading the Startup Sequence Without INITIALIZER
To receive Param messages, bit 1 of the first byte must be 1. All other bits
must be 0.
If you do not reply to the Startup message or if you reply with some other reply
code, then your process will receive no further startup sequence messages.
4. Read and process each Assign message if there are any and reply to each Assign
message with a reply code of 0.
5. Read the Param message if there is one, process it, and reply to it with a reply
code of 0.
6. If unexpected messages are received, the program must reply to them with the
reply code 100 and continue.
7. Read the Close message and close $RECEIVE.
The following sample procedure performs the above tasks using reply code 70 to
request Assign and Param messages.
PROC READ^STARTUP^SEQUENCE;
BEGIN
STRING .RCV^NAME[0:ZSYS^VAL^LEN^FILENAME - 1];
INT RCV^NUM,
NAMELEN,
.RCV^BUF[0:514],
COUNT^READ,
REPLY^CODE = 0,
ERROR,
S^PTR;
LITERAL RCV^DEPTH = 1,
RCV^COUNT = 1030,
CLOSE^MSG = -104;
! Open $RECEIVE:
RCV^NAME ':=' "$RECEIVE" -> @S^PTR;
NAMELEN := @S^PTR '-' @RCV^NAME;
ERROR := FILE_OPEN_(RCV^NAME:NAMELEN,
RCV^NUM,
!access!,
!exclusion!,
!nowait^depth!,
RCV^DEPTH);
IF ERROR <> 0 THEN ...;
! Read the Open message from $RECEIVE:
CALL READUPDATE(RCV^NUM,RCV^BUF,RCV^COUNT,COUNT^READ);
CALL FILE_GETINFO_(RCV^NUM,ERROR);
IF ERROR <> 6 THEN CALL PROCESS_STOP_;
! Loop until Close message received
WHILE RCV^BUF <> CLOSE^MSG DO
BEGIN