Guardian Programmer's Guide

Table Of Contents
Writing a Command-Interpreter Monitor ($CMON)
Guardian Programmer’s Guide 421922-014
23 - 82
Sample Command-Interface Program
!-----------------------------------------------------------
! Procedure to prompt the user for the next function to
! perform:
!
! "1" to change the logon message
! "2" to change the logoff message
! "3" to prohibit requests during shutdown
! "4" to re-enable requests
! "5" to change the processor status
! "x" to exit the program
!
! The selection made is returned as the result of the call.
!------------------------------------------------------------
INT PROC GET^COMMAND;
BEGIN
INT BYTES^READ;
! Prompt the user for the function to be performed:
PRINT^BLANK;
PRINT^STR("Type '1' to change the logon message ");
PRINT^STR(" '2' to change the logoff message ");
PRINT^STR(" '3' to prohibit requests in shutdown ");
PRINT^STR(" '4' to re-enable requests ");
PRINT^STR(" '5' to change the processor status ");
PRINT^STR(" 'x' to exit the program ");
SBUFFER ':=' "Choice: " -> @S^PTR;
CALL WRITEREADX(TERMNUM,SBUFFER,@S^PTR '-' @SBUFFER,
BUFSIZE,BYTES^READ);
IF <> THEN CALL FILE^ERRORS(TERMNUM);
SBUFFER[BYTES^READ] := 0;
RETURN SBUFFER[0];
END;