Guardian Programmer's Guide

Table Of Contents
Writing a Command-Interpreter Monitor ($CMON)
Guardian Programmer’s Guide 421922-014
23 - 58
Sample $CMON Program
! If accepting the request:
BEGIN
! Allow priority change only if operator group attempting
! to reduce priority:
CALL PROCESS_GETINFO_(ALTPRI^MSG.PHANDLE,
!file^name:maxlen!,
!file^name^len!,
PRIORITY);
IF (PRIORITY > ALTPRI^MSG.PRIORITY) OR
(REQUESTING^GROUPID = 255) THEN
ALTPRI^REPLY.REPLYCODE := 0
ELSE
BEGIN
ALTPRI^REPLY.REPLYCODE := 1;
ALTPRI^REPLY.REPLYTEXT ':='
"Cannot increase process priority";
END;
END;
! Send the reply to the TACL process:
CALL REPLYX(ALTPRI^REPLY,$LEN(ALTPRI^REPLY));
END;