Guardian Programmer's Guide

Table Of Contents
Writing a Command-Interpreter Monitor ($CMON)
Guardian Programmer’s Guide 421922-014
23 - 79
Sample Command-Interface Program
!------------------------------------------------------------
! Procedure to generate an RT^start^message and send it to
! the $CMON process.
!------------------------------------------------------------
PROC ACCEPT^REQUESTS;
BEGIN
STRUCT RT^START^MESSAGE; !structure to send to $CMON
BEGIN
INT MSGCODE;
END;
INT BYTES^READ;
! Set message code in message structure for the restart
! message:
RT^START^MESSAGE.MSGCODE := 62;
! Send the structure to the $CMON process:
CALL WRITEREADX(CMONNUM,RT^START^MESSAGE,
$LEN(RT^START^MESSAGE),
2,BYTES^READ);
IF <> THEN CALL FILE^ERRORS(CMONNUM);
END;