Guardian Programmer's Guide

Table Of Contents
Writing a Command-Interpreter Monitor ($CMON)
Guardian Programmer’s Guide 421922-014
23 - 29
Setting the Logon Display Text at Run Time
Setting the Logon Display Text at Run Time
The following code fragments show how a command-interface program and a $CMON
process can change the logon display text at run time. Here, (plus) 50 has been
chosen as the message code for a message containing logon text.
The command-interface program prompts the operator for the logon text, puts the text
into a data structure with the message code of 50, and then sends it to $CMON.
$CMON reads the message from its $RECEIVE file, identifies it as a change logon text
message, checks that the sender belongs to the operations group, and if so changes
its logon-text buffer accordingly. $CMON will respond to future Logon^msg messages
using the modified text string.
In the command-interface program:
STRUCT RT^LOGON^MSG; !structure for run-time logon
BEGIN ! message
INT MSGCODE; !value (plus) 50
STRING LOGON^MSG[0:n]; !the logon message; 132 bytes
END; ! maximum
.
.
!Prompt operator for new logon text:
SBUFFER ':=' "Enter New Logon Text" -> @S^PTR;
WCOUNT := @S^PTR '-' @SBUFFER;
RCOUNT := 132;
CALL WRITEREADX(TERM^NUM,SBUFFER,WCOUNT,RCOUNT,BYTES^READ);
!Fill in RT^LOGON^MSG data structure and send it to $CMON:
RT^LOGON^MSG.MSG^CODE := 50;
RT^LOGON^MSG.LOGON^MSG ':=' SBUFFER[0] FOR BYTES^READ;
WCOUNT := BYTES^READ + 2;
CALL WRITEREADX(CMON^NUM,RT^LOGON^MSG,WCOUNT,RCOUNT,
BYTES^READ);