Guardian Programmer's Guide

Table Of Contents
Writing a Command-Interpreter Monitor ($CMON)
Guardian Programmer’s Guide 421922-014
23 - 12
Controlling Logoff
Controlling Logoff
The TACL process sends a Logoff^msg message to $CMON whenever a user logs off
either explicitly by issuing a LOGOFF command or implicitly by logging on without first
logging off. This message gives $CMON the option of displaying message text on
logging off. The $CMON process is not able to reject a request to log off.
The format of the Logoff^msg message is given below:
The $CMON process replies using a Logoff^reply structure in the format shown below.
Note that the reply code in this case is ignored by the TACL process because $CMON
cannot reject a logoff request:
The following code fragment returns a message to the TACL process after receiving a
logoff request:
CALL READUPDATEX(RECV^NUM,SBUFFER,RCOUNT,BYTES^READ);
IF BUFFER[0] = -51 THEN
BEGIN
LOGOFF^REPLY.REPLYTEXT ':=' ["Logging off...Bye!",0];
SCAN LOGOFF^REPLY.REPLYTEXT UNTIL 0 -> @LAST;
REPLY^LEN := 2 + @LAST - @LOGOFF^REPLY.REPLYTEXT;
CALL REPLYX(LOGON^REPLY,REPLY^LEN);
END;
Format of command-interpreter message -51 (Logoff^msg message):
STRUCT LOGOFF^MSG;
BEGIN
INT MSGCODE; ![0] value -51
INT USERID; ![1] user ID of user logging off
INT CIPRI; ![2] current priority of
! TACL process
INT CIINFILE[0:11]; ![3] name of the command file
! for the TACL process
INT CIOUTFILE[0:11]; ![15] name of the list file for
! the TACL process
END;
Format of Logoff^reply structure:
STRUCT LOGOFF^REPLY;
BEGIN
INT REPLYCODE; ![0] ignored by TACL process
STRING REPLYTEXT[0:n];![1] optional display text;
! maximum length is 132 bytes
END;