Guardian Programmer's Guide

Table Of Contents
Writing a Command-Interpreter Monitor ($CMON)
Guardian Programmer’s Guide 421922-014
23 - 91
A TACL Macro for Debugging and Testing a $CMON
Program
== Open $CMON socket:
#SET cmon^process^name $CMOO == Temporary name of
== $CMON process
#SET cmon^process^sock == .#cmon
#SET status [#REQUESTER/WAIT 5000/READ &
[cmon^process^name][cmon^process^sock] &
r^error r^rec prompt]
== Send a Prelogon^msg request and display the reply:
#SET to^cmon:message^code -59
#APPENDV prompt to^cmon
#EXTRACTV r^rec prelogon^reply
#OUTPUTV prelogon^reply
== Send a Config^msg request and display the reply:
#SET to^cmon:message^code -60
#APPENDV prompt to^cmon
#EXTRACTV r^rec cmon
[#IF [cmon:tacl^config:reply^code] |THEN|
#OUTPUTV cmon:configreply^text
|ELSE|
#OUTPUTV cmon:tacl^config
]
== Send a Logon^msg request and display the reply:
#SET to^cmon:message^code -50
#APPENDV prompt to^cmon
#EXTRACTV r^rec loggedon^reply
#OUTPUTV loggedon^reply
== Close $CMON:
#SET status [#REQUESTER/WAIT 5000/CLOSE r^rec]
#UNFRAME
For details of TACL programming techniques, see the TACL Programming Guide.