.ENABLE QUIET ! .ENABLE TRACE !******************************** RUNOFF.IND ********************************* .DISABLE LOWERCASE .TEST P1 .IF EQ 0 .ASKS P1 Input file .IF P1 = "" .GOTO HELPME .IF P1 = "?" .GOTO HELPME .IF P1 = "HELP" .GOTO HELPME .SETS NP1 P1 .SETS SP1 P1[1:1] .IF SP1 = "/" .SETS NP1 P2+P1 .PARSE NP1 "/" SPEC S1 S2 S3 S4 S5 S6 S7 S8 S9 S10 S11 S12 S13 S14 S15 ! After any parse STRLEN holds the number of parses .SETN SWINUM (-1) .; SWINUM is the number of switches .IF SPEC = "HELP" .GOTO HELPME ! Extract the device, file name, and extension from FILE .GOSUB DEFALT .; do this once to init all defaults .GOSUB EXTRAC .; extract the dev name ext from spec .GOSUB TESNAM .;if you return from tesnam the file was found .SETN INDEX 1. .; init index to 1 .LOOP: .IF INDEX > SWINUM .GOTO RUNOFF ! substitution mode is default that is why the next line works so good ! it will set the whole switch in succesion = to Sn .SETS Sn S'INDEX' .;Set Sn equal to switch S(n) .SETS CH1 Sn[1.:1.] .;Set CH1 equal to the first char of Sn ! Call the proper string handling subroutine. ! Sn and SWITCH are the parameters to be passed to ! and from the subroutine. .GOSUB 'CH1' .INC INDEX .; add one to the index which will go to the next switch .GOTO LOOP ! ***** SET ALL OF THE DEFAULT FLAGS, SWITCHES, ETC SUBROUTINE ***** .DEFALT: .SETS DEFDEV "DK:" .; default device .SETS DEFNAM "" .SETS DEFEXT ".RNO" .; default extension .SETS PDEV "TT:" .; default to the terminal .SETS TOC "" .; start with no table of contents .SETS SWITCH "" .; start all switches to no switches .SETF LPFLAG .; turn LP: off .SETF LNFLAG .; turn LN: off .SETT TTFLAG .; default to the terminal if no print switch .RETURN .EXTRAC: ! This subroutine extracts a device name, a file name, and a file extension ! from the string SPEC and returns the strings DEV, NAME, and EXT. .TEST SPEC ":" .IF = 0 .SETS SPEC DEFDEV+SPEC .;Use the default device if one is not given .TEST SPEC "." .IF = 0 .SETS SPEC SPEC+DEFEXT .;Use the default extension if one is not given .PARSE SPEC ":." DEV NAME EXT .TEST EXT .IFF .GOTO EXTERR .SETS EXT "."+EXT .TEST DEV .IFF .GOTO DEVERR .SETS DEV DEV+":" .TEST NAME .IFF .GOTO NAMERR .IF = 0 .SETS NAME DEFNAM .RETURN .TESNAM: ! This subroutine checks the validity of a given device and file name. ! If not valid, print an error message and exit the program. .IF DEV = "NL:" .RETURN .IF DEV = "LN:" .RETURN .IF DEV = "LP:" .RETURN .TESTFILE 'DEV''NAME''EXT' .IF = 1 .RETURN .GOTO '' ! Error messages: .DEVERR: @sy:DISPLA.Ind -- RUNOFF.Ind ERROR: device ('DEV':) contains non-Radix-50 characters .EXIT .EXTERR: @sy:DISPLA.Ind -- RUNOFF.Ind ERROR: extension (.'EXT') contains non-Radix-50 characters .EXIT .NAMERR: @sy:DISPLA.Ind -- RUNOFF.Ind ERROR: file name ('NAME') contains non-Radix-50 characters .EXIT ! IND error messages .346: @sy:DISPLA.Ind -- RUNOFF.Ind ERROR: file 'DEV''NAME''EXT' not found. .EXIT .340: @sy:DISPLA.Ind -- RUNOFF.Ind ERROR: device ('DEV') read error. .EXIT .312: @sy:DISPLA.Ind -- RUNOFF.Ind ERROR: bad file name ('NAME'). .EXIT .244: @sy:DISPLA.Ind -- RUNOFF.Ind ERROR: invalid device ('DEV'). .EXIT .372: .366: .363: .351: .343: .337: .333: .327: .325: .324: .313: @sy:DISPLA.Ind -- RUNOFF.Ind ERROR: = '' @sy:DISPLA.Ind See Table 5.6 (IND special symbols) of RT-11 System Users Guide .EXIT ! ***** MAKE AN LN03 PREFIX FILE SUBROUTINE ***** .LN03: .; .; Define escape sequences for LN03 printer .; ^& turns on underlining .; \& turns off underlining .; & underline 1 char .; ^* turns on bolding .; \* turns off bolding .; * bolds 1 char .; ^~ turns on reverse video (Ignored on LA-50) .; \~ turns off reverse video .; ^= turns on double width .; /= turns off double width .; < Starts subscipt .; > Starts superscript .; ^% turns on vt100 graphics set .; \% turns off vt100 graphics .; .; NOTE: underlining, bolding, reverse can not be independently combined. .; If more than 1 feature is desired they must be turned on and off .; together. .; Double width is 5 pitch. .; Single width is 10 pitch. .; .DATA #2 .; Define escape sequences for LN03 printer .DATA #2 .reset escape .DATA #2 .define escape "^`" 27 "c" .DATA #2 .define escape "^!" 27 "+0" .DATA #2 .define escape "^1" 27 "[11m" .DATA #2 .define escape "^2" 27 "[12m" .DATA #2 .define escape "^3" 27 "[13m" .DATA #2 .define escape "^4" 27 "[14m" .DATA #2 .define escape "^5" 27 "[15m" .DATA #2 .define escape "^6" 27 "[16m" .DATA #2 .define escape "^7" 27 "[17m" .DATA #2 .define escape "^8" 27 "[18m" .DATA #2 .define escape "^9" 27 "[19m" .DATA #2 .define escape "^*" CHR LCK 27 "[1m" .DATA #2 .define escape "\*" CHR LCK 27 "[0m" .DATA #2 .define escape "^&" CHR LCK 27 "[4m" .DATA #2 .define escape "\&" CHR LCK 27 "[0m" .DATA #2 .define escape "^~" CHR LCK 27 "[7m" .DATA #2 .define escape "\~" CHR LCK 27 "[0m" .DATA #2 .define escape "^=" LCK PSP HSP 2 27 "[5w" .DATA #2 .define escape "\=" LCK PSP HSP 1 27 "[0w" .DATA #2 .define escape "^<" VSP 1 27 "K" .DATA #2 .define subscript 27 "K" .DATA #2 .define escape "^>" VSP -1 27 "L" .DATA #2 .define superscript 27 "L" .DATA #2 .define escape "^#" CHR LCK 27 "[5m" .DATA #2 .define escape "\#" CHR LCK 27 "[0m" .DATA #2 .define escape "^%" CHR LCK 27 "o" .DATA #2 .define escape "\%" CHR LCK 15 .DATA #2 .no flags underline .DATA #2 .flags special *&< .DATA #2 .flags escape .DATA #2 .flags equation .RETURN ! ***** MAKE A VT100 PREFIX FILE SUBROUTINE ***** .VT100: .; Define escape sequences for VT-100 terminal .; ^& turns on underlining .; \& turns off underlining .; & underline 1 char .; ^* turns on bolding .; \* turns off bolding .; * bolds 1 char .; ^~ turns on reverse video .; \~ turns off reverse video .; ^= turns on double width .; /= turns off double width .; ^# turns on blinking chars. .; \# turns off blinking chars. .; ^% turns on vt100 graphics set .; \% turns off vt100 graphics .; .; ^+ turns on upper double width and height .; \+ turns off upper double width and height .; ^- turns on lower double width and height .; \- turns off lower double width and height .; .; ^< will produce subscripts .; ^> produces superscripts .; .; .;NOTE: underlining, bolding, reverse and blinking can not be independently .; combined. .; Multiple features must be turned on and off in tandem. .; Double width applies to the whole line .DATA #2 .; Define escape sequences for VT-100 terminal .DATA #2 .reset escape .DATA #2 .define escape "^*" CHR LCK 27 "[1m" .DATA #2 .define escape "\*" CHR LCK 27 "[0m" .DATA #2 .define escape "^&" CHR LCK 27 "[4m" .DATA #2 .define escape "\&" CHR LCK 27 "[0m" .DATA #2 .define escape "^~" CHR LCK 27 "[7m" .DATA #2 .define escape "\~" CHR LCK 27 "[0m" .DATA #2 .define escape "^=" LCK PSP HSP 2 27 "#6" .DATA #2 .define escape "\=" LCK PSP HSP 1 "" .DATA #2 .define escape "^<" VSP 2 10 .DATA #2 .define subscript 10 .DATA #2 .define escape "^>" VSP -2 27 "[1A" .DATA #2 .define superscript 27 "[1A" .DATA #2 .define escape "^#" CHR LCK 27 "[5m" .DATA #2 .define escape "\#" CHR LCK 27 "[0m" .DATA #2 .define escape "^%" CHR LCK 14 .DATA #2 .define escape "\%" CHR LCK 15 .DATA #2 .no flags underline .DATA #2 .flags special *& .DATA #2 .flags escape .DATA #2 .define ESCAPE "^+" 27 "#3" .DATA #2 .define escape "^-" 27 "#4" .DATA #2 .define escape "\-" LCK PSP HSP 1 "" .DATA #2 .define escape "\+" LCK PSP HSP 1 "" .RETURN ! ********** ADD DEFAULT RUNOFF COMMANDS TO WORK FILE ********** .SETUP1: .DATA #2 .list 0 .list 0 .display elements lu .DATA #2 .list 0 .display elements ll .DATA #2 .end list 0 .end list 0 .end list 0 .DATA #2 .paper size 65,75,10,3 .DATA #2 .layout 2 .DATA #2 .display number "-",D,"-" .RETURN ! ***************** all switch subroutines below *********** .E: .; Output even page switch .F: .; Print standard formfeed or simulate FF w/LF .G: .; UPPERCASE page switch .; no hyphenate overrides enable hyphenate .H: .; HYPHENATE output or no hyphenate .M: .; Output WARNING or NO WARNING messages .O: .; Output ODD pages or NO ODD pages .W: .; WAIT or NO WAIT for CR between pages .2: .; Perform 2 passes or one pass .; test for a no switch .TESNO: .PARSE Sn ":" Sn NOSWCH .TEST NOSWCH "N" .IF > 0 .SETS SWITCH SWITCH+"/"+CH1+":N" .IF EQ 0 .SETS SWITCH SWITCH+"/"+CH1 .RETURN .A: .; only this appendix range .C: .; only this chapter range .PA: .; only this page range .R: .; right shift n places .S: .; set hardware size .PARSE Sn ":" Sn LOWHI .SETS SWITCH SWITCH+"/"+CH1+":"+LOWHI .RETURN .D: .SETS PDEV "DK:" .; Output to DK:.doc .RETURN .L: .SETT LNFLAG .; send output to LN: .SETF TTFLAG .; turn off the terminal if LP true .SETF LPFLAG .; turn off LP if LN is true .RETURN .I: .; print available switch options .X: .; exit the program .SETS SWITCH SWITCH+"/"+CH1 .RETURN .N: .SETS CH2 Sn[2.:2.] .SETS NOSWCH "" .TEST CH2 "O" .; see if is a NO switch .IF > 0 .SETS NOSWCH Sn[3.:6.] .IF = 0 @sy:DISPLA.Ind -- RUNOFF.Ind ERR: invalid NO switch .SETS CH1 NOSWCH[1.:1.] .; set up to test for E,O,M,H .IF CH1 NE "W" .SETS SWITCH SWITCH+"/"+CH1+":N" .TEST NOSWCH "WAI" .; no wait for carraige return .IF > 0 .SETS SWITCH SWITCH+"/W:N" .TEST NOSWCH "WAR" .; no warning messages .IF > 0 .SETS SWITCH SWITCH+"/M:N" .RETURN .P: .TEST Sn "PR" .; is it PRINT switch or PAGE switch .IF EQ 0 .GOTO PA .SETF TTFLAG .; turn off the terminal if LP true .SETF LNFLAG .; turn off LN if LP is true .SETT LPFLAG .; turn on LP: .RETURN .T: .TEST Sn "TO" .; is it TERMINAL switch or TOC switch .if > 0 .SETS TOC ","+NAME+".RNT" .; Table of contents .IF EQ 0 .GOTO TT .RETURN .V: .; VT100 output .TT: .SETT TTFLAG .; turn on the terminal if LP true .SETF LNFLAG .; turn off LN if LP is true .SETF LPFLAG .; turn off LP: .RETURN .U: .TEST Sn "UP" .; is it UPPERCASE switch or UNDERLINE switch .if > 0 .SETS SWITCH SWITCH+"/G" .; same as /G .IF = 0 .GOTO UL .RETURN .UL: .GOSUB TESNO .TEST NOSWCH "B" .; Underline with ul char and backspace .IF > 0 .SETS SWITCH SWITCH+":B" .TEST NOSWCH "L" .; Underline with ul char and line overprint .IF > 0 .SETS SWITCH SWITCH+":L" .TEST NOSWCH "S" .; Underline with hyphen on next line .IF > 0 .SETS SWITCH SWITCH+":S" .RETURN .1: .3: .4: .5: .6: .7: .8: .9: .0: .B: .J: .K: .Q: .U: .Y: .Z: @sy:Displa.IND *** SWITCH ERROR *** no 'Sn' switch available .RETURN ! ****** OPEN THE WORK FILE AND PUT IN THE PROPER ESCAPE SEQUENCES .RUNOFF: .OPEN #2 WF:'NAME'.PRE .IFT LNFLAG .GOSUB LN03: .; add escape sequence for LN03 to wf: .IFT TTFLAG .GOSUB VT100: .; add escape sequence for VT100 to wf .GOSUB SETUP1: .; add rno default commands to wf: .close #2 .; close the work file .IF PDEV = "DK:" .GOTO TFIL .; force all output to dk: .IFT LNFLAG .SETS PDEV "LN:" .; send output to LN: .IFT LPFLAG .SETS PDEV "LP:" .; send output to LP: .IFT TTFLAG .SETS PDEV "TT:" .; send output to VT100 ! ******* OPEN A TEMP WORK FILE TO DO RUNOFF COMMANDS AS AN IND FILE .TFIL: @sy:DISPLA.IND 'NAME''EXT' .OPEN #1 wf:'NAME'.TMP .DATA #1 R RUNOFF.BL .DATA #1 'PDEV''NAME'.DOC'TOC'=WF:'NAME'.PRE,'DEV''NAME''EXT''SWITCH' .DATA #1 ^C .DATA #1 DELETE/NOQUERY WF:'NAME'.PRE ! Delete the temp file from WF: .CLOSE #1 $@WF:'NAME'.TMP DELETE/NOQUERY WF:'NAME'.TMP ! Delete the temp file from WF: .EXIT ! ! END OF !********************************** RUNOFF.IND ******************************! ! RUNOFF.IND Documentation .HELPME: .DISABLE QUIET .SETN INDEX 1. .HLOOP: .GOSUB PAGE'INDEX' .INC INDEX .IF INDEX > 5. .SETN INDEX 1. .ASK [] CONTIN Continue .IFF CONTIN .EXIT .GOTO HLOOP .PAGE1: !******************************* RUNOFF.IND *********************************! ! RUNOFF IND indirect command procedure to run RUNOFF.BL ! ! ! ! Version 1.0 by Ed Hendrickson 5-May-1987 Help screen #1 ! ! ! ! the available switches are: ! ! /A*ppendix:l:h Output only the indicated appendix range (l=low, h=high). ! ! /C*hapter:l:h Output only the indicated chapter range (l=low, h=high). ! ! /E*ven Output even pages. ! ! /E*ven:N DO NOT output even pages. ! ! /D*k Forces all output to DK: . ! ! /F*ormfeed Print standard ascii formfeed character. ! ! /F*ormfeed:n Simulate formfeed character with multiple linefeeds. ! ! /G Force all text to be output in uppercase. ! ! /G:N Allow text to be output as input ! ! /H*yphenate Hyphenate the output ! ! /H*yphenate:N DO NOT hyphenate the output (overrides .ENABLE HYPHENATION).! ! /I*nformation Print standard runoff switch options to terminal ! ! /L*n03 Output to LN: ! ! /NOE*ven DO NOT output even pages (same as /E:N). ! ! /NOH*phenate DO NOT hypthenate the output (same as /H:N). ! ! ! !****************************************************************************! .RETURN .PAGE2: !******************************* RUNOFF.IND *********************************! ! RUNOFF.IND Version 1.0 by Ed Hendrickson 5-May-1987 Help screen #2 ! ! ! ! switches continued: ! ! ! ! /NOO*dd DO NOT output odd pages (same as /O:N). ! ! /NOWAI*t DO NOT wait for carriage return (same as /W:N). ! ! /NOWAR*ning DO NOT output warning messges (same as /M:N). ! ! /P*age:l:h Output only the indicated page range (l=low, h=high). ! ! /PR*int Output to the line printer LP: ! ! /R*ightshift:n Right shift output n spaces. Useful for bound pages ! ! /S*et:h:w Set hardware page size (h=height of page, w=width of page). ! ! /T*erminal Output to your VT100 terminal. ! ! /TO*c Output a Table Of Contents file called .RNT . ! ! /UP*percase Force all text to be output in uppercase (same as /G) ! ! /U*nderline:B Underline with underline character and backspace. ! ! /U*nderline:L Underline with underline character and line overprint. ! ! /U*nderline:S Underline with hyphen on next line. ! ! /U*nderline:N DO NOT underline text. (overrides .ENABLE UNDERLINE) ! ! /V*t100 Output to a VT100 terminal (same as /T). ! ! /X Exit runoff ! ! /2 Perform 2 passes ! !****************************************************************************! .RETURN .PAGE3: !******************************** RUNOFF.IND ********************************! ! RUNOFF.IND Version 1.0 by Ed Hendrickson 5-May-1987 Help screen #3 ! ! ! ! The switches can go either after the filename or after the command name. ! ! Usually only one letter is needed for each switch. The order of the ! ! switches does not matter. A scratch file is built on WF: . ! ! ! ! Examples: RO/PRINT JUNK.RNO ! ! RO JUNK/TT/NOODD ! ! Ro/p junk ! ! Ro Junk/p/noo ! ! ro/noo/nowar/v/d junk ! ! ! ! ! !****************************************************************************! ! ! ! ! ! ! ! ! .RETURN .PAGE4: !******************************** RUNOFF.IND ********************************! ! RUNOFF.IND Version 1.0 by Ed Hendrickson 5-May-1987 Help screen #4 ! ! ! ! Runoff default file extension is .RNO . When a .RNO file is input into ! ! RUNOFF.IND it will output a .DOC ( document ) file. If the /Term switch ! ! is used then the document will go to TT: . If /DK/Term is used then a ! ! document file is created on DK: that has escape codes embedded in it for ! ! output to a VT100 terminal, i.e. the document can be typed to a VT100. ! ! ! ! Runoff file extensions: ! ! ! ! .RNO Runoff source (Runoff input) ! ! .DOC document, generated from Runoff (Runoff output) ! ! .RNT Runoff TOC source, created by /TOC (Runoff input and output) ! ! ! ! Default values are: /Terminal/G:N/F/H/R:0./S:58.:60./U:L/W:N/E/O/M/2:N ! ! ! !****************************************************************************! ! ! ! ! ! .RETURN .PAGE5: !******************************* RUNOFF.IND *********************************! ! RUNOFF.IND Version 1.0 by Ed Hendrickson 5-May-1987 Help screen #5 ! ! ! ! ! ! .RO :== Ind Sy:RUNOFF.Ind ^ - should be defined for TSX+ & some RT UCLs ! ! .RO - will then invoke RUNOFF. ! ! ! ! Or if your UCL will not support the above method, ! ! ! ! .COPY Sy:RUNOFF.Ind DK:RUNOFF.COM - put RUNOFF.Com in your default disk. ! ! .@RUNOFF - for any user with SET KMON IND or ! ! .IND RUNOFF - for any user with SET KMON NOIND . ! ! ! !****************************************************************************! ! ! ! ! ! ! ! ! ! .RETURN