PROGRAM XQT C C C C Author: K.W. Kohnmann XX-XXX-87 C 3M Co. M.M.D. Dept. 5359 C 350 South Lewis Road C Camarillo, Calif. 93010 C C Machine: D.E.C. (Digital Equipment Corp.) PDP 11/70 C C System: RSX-11M-PLUS V3.0 BL24D C C Rev. History: 15-OCT-87 - DFH - Added GETMCR C C Source: Fortran 77 V5.0-16 - DR4:[,] C C Description: This program will execute any MCR command on any terminal. C C Data Files: N/A C C Subroutines: N/A C C Definitions: SYMBOL - TYPE - USAGE C ------- ------- ------------------------------------------- C MCR - REAL - Address of RAD50 task to receive spawn C TTLOC - INTEGER - Terminal to spawn command from C CMD - CHAR*79 - Command to Spawn C IDS - INTEGER - Address of DSW C IESB - INTEGER - Address of 8 word status buffer C CMDBUF - BYTE(80)- Incomming command string C C C C------------------------------------------------------------------------------- C Define variables C------------------------------------------------------------------------------- C REAL MCR C BYTE CMDBUF(80),CMD(79) C INTEGER TTLOC,IDS,IESB(8) C DATA MCR/6RMCR.../ C C------------------------------------------------------------------------------- C See if a command line was passed to this task C------------------------------------------------------------------------------- C CALL GETMCR(CMDBUF,IDS) ! Get a command line IF (IDS .GE. 1) GOTO 10 ! Was there one? GOTO 100 ! Nope - Go see want user wants C 10 IF (IDS .LT. 5) GOTO 100 ! Need TT & Command IF (CMDBUF(4) .NE. ' ') GOTO 300 ! SYNTAX ERROR IF (CMDBUF(5) .EQ. '?') GOTO 320 ! User wants help IF (CMDBUF(5).EQ.'H'.OR.CMDBUF(5).EQ.'h') GOTO 320 ! Help user IF (CMDBUF(6) .EQ. ' ') GOTO 20 ! Only 1 digit TT# IF (CMDBUF(5).LT.'0'.OR.CMDBUF(5).GT.'7') GOTO 300 IF (CMDBUF(6).LT.'0'.OR.CMDBUF(6).GT.'7') GOTO 300 DECODE (2,12,CMDBUF(5)) TTLOC ! Two digit TT# 12 FORMAT (O2) ILOC = 7 GOTO 30 C 20 IF (CMDBUF(5).LT.'0'.OR.CMDBUF(5).GT.'7') GOTO 300 DECODE (1,22,CMDBUF(5)) TTLOC ! One digit TT# 22 FORMAT (O1) ILOC = 6 C C------------------------------------------------------------------------------- C We have the TT# now get the command to spawn C------------------------------------------------------------------------------- C 30 ILEN = IDS - ILOC DO 40 I = 1,ILEN 40 CMD(I) = CMDBUF(I+ILOC) C GOTO 200 C C------------------------------------------------------------------------------- C Prompt the user for what he should have sent already C------------------------------------------------------------------------------- C 100 type 110 110 format(' Enter the TT # you wish to Spawn the command from ', 1 '( OCT ) :',$) c accept 120,ttloc 120 format(o3) c 130 type 140 140 format(' Enter the Command you wish to spawn ( 79 chars max)',/, 1 1X,'>>',$) c accept 150,cmd 150 format(79A1) C ILEN = 79 C C------------------------------------------------------------------------------- C Run the command !! C------------------------------------------------------------------------------- C 200 call spawn(mcr,,,4,,iesb,,cmd,ILEN,ttloc,'TT',ids) CALL EXIT(1) C C------------------------------------------------------------------------------- C Syntax error and help messages C------------------------------------------------------------------------------- C 300 WRITE (5,310) 310 FORMAT (//,1X,'XQT -- SYNTAX ERROR -- Type XQT ? for help') CALL EXIT(4) C 320 WRITE (5,330) 330 FORMAT (1X,'...XQT accepts commands in the following formats:', 1 //,1x,'XQT',/,1x,'XQT ? - Displays these help messages', 2 /,1x,'XQT TT# Command string',/, 3 t10,'where TT# is a 1 or 2 digit OCTAL terminal #',/, 4 t10,'and command string is a mcr command line < 80 chars.') CALL EXIT(1) c end