[Search for users]
[Overall Top Noters]
[List of all Conferences]
[Download this site]
Title: | AMIGA NOTES |
Notice: | Join us in the *NEW* conference - HYDRA::AMIGA_V2 |
Moderator: | HYDRA::MOORE |
|
Created: | Sat Apr 26 1986 |
Last Modified: | Wed Feb 05 1992 |
Last Successful Update: | Fri Jun 06 1997 |
Number of topics: | 5378 |
Total number of notes: | 38326 |
5205.0. "Useful VMS Utility" by VERGA::MACDONALD (Home of Digital Realtime Pubs) Thu Nov 14 1991 18:06
This com file that runs on VMS will allow you to print a file on your
VMS account directly to the printer attached to your Amiga. Saves you
the trouble of downloading the file.
++++++++++++++++++++++++++++++++++++++
$! ** type ext/nohead PPSU.COM **
$! *** PLEASE NOTE - THIS IS NOT A SUPPORT PRODUCT ***
$VERIFYFLG=F$VERIFY()
$!!!!SET NOVERIFY
$ON ERROR THEN $GOTO RESET_TERMINAL
$ON CONTROL_Y THEN $GOTO RESET_TERMINAL
!*****************************************************************
!* *
!* Name: PPSU.COM (Personal Printer Spooling Utility) *
!* Version: V1 (July 1984) *
!* Author: Don Soule, PSG MIS/DSS, MK01-2/G37, DTN 264-4614 *
!* *
!* Modified by: David K. Headley, PSG System Manager *
!* NQO/1S17, DTN 264-7295 *
!* Version : V2 (October 1984) *
!* *
!* The modification adds the ability to print more *
!* than one copy of a given file. Form feeds are *
!* used between copies for formatting purposes. The *
!* summary of command has been broken up into two *
!* display lines and displays unique messages based *
!* on the number of copies to be printed. *
!* *
!* Version : V3 (October 1984) *
!* *
!* Added the capability of answering the filename *
!* prompt with "PSETUP" and the procedure will set *
!* the characteristics you specified then exit *
!* leaving the printer with the specified settings. *
!* *
!* Modified by: Don Soule, still at the above location... *
!* Version : V4 (March 1985) *
!* *
!* I have added more documentation and fixed the *
!* problem where the printer would advance extra *
!* lines after the form feed. Also, form feeds will *
!* not occur if "NFF" was entered when asked for *
!* the number of copies (this was a user request as *
!* he felt too much paper was being wasted). *
!* *
!* Version : V5 (April 1985) *
!* *
!* It seems that V4 of VMS doesn't automatically *
!* set width to 132 when SET TERM/DEV=LA100 is done *
!* and this was causing wrap-around. I fixed this *
!* by adding a /WIDTH=132 to the command. *
!* *
!*****************************************************************
!* *
!* What: Allows printers, connected to video terminals via *
!* printer port, to act as spooling devices. *
!* *
!* How: Upon execution, this VMS DCL command file will use *
!* the parameters specified to cause terminal output to *
!* be directed to the printer. If parameters are not *
!* present at execution, the command file will prompt *
!* for them. *
!* *
!* Parameters needed: Printer Type *
!* Horizontal Pitch *
!* Draft or Letter Quality *
!* File to be Printed *
!* # of copies *
!* *
!* Instructions for Use on PCs... *
!* *
!* You may use this utility on Personal Computers that *
!* are in terminal emulation mode. *
!* *
!* ROBIN: Boot the system for CP/M. This will set up terminal/ *
!* printer interface via PSETUP. Make sure printer *
!* functions correctly by entering a (CTRL-P) and doing *
!* a directory. If the printed output looks good, enter *
!* another (CTRL-P) to toggle-off the printer. Enter *
!* terminal emulation via POLY-XFR. You do this by in- *
!* serting the proper diskette (the one with POLY-XFR *
!* on it) and entering TRM. Hit the PF3 key for commun- *
!* ications and log into your VAX. If your printer *
!* starts copying everything on the terminal screen hit *
!* the (CTRL-A) P keys to toggle-off the printer. You *
!* may now use this utility. Entering the (CTRL-A) X *
!* keys will bring you back to CP/M. *
!* *
!* PRO350: In order to use this PC as a terminal you must go *
!* through PRO/Communications. This will handle the *
!* necessary terminal/printer interface. *
!* *
!* RAINBOW: The set-up features should look like the following: *
!* *
!* PARAM SET *
!* --------- *
!* 0100 1100 1000 1011 1010 1001 10 *
!* *
!* PRINTER *
!* ------- *
!* 7S = DATA B/P *
!* 4800 = XMT/RCV BAUD *
!* *
!* Use this PC in terminal mode connected to the VAX *
!* and you should have no problem. *
!* *
!* DECmate: This utility can't easily be used with the DECmate *
!* due to WPS controlling terminal emulation. Under WPS *
!* you must enter "CX" to get to the communications *
!* menu where KH (Keyboard to Host) and HS (Host to *
!* Screen) are defaults. Output to the printer is done *
!* by setting HP (Host to Printer) and then returning *
!* to terminal emulation. This is a hindrance to the *
!* process and it is recommended you not try to use *
!* PPSU with a DECmate. *
!* *
!* Possible Horizontal Pitch/Letter Quality? *
!* *
!* LA34 LA50 LA100 LA120 Max.# Col *
!* *
!* 10 no 10 yes 10 yes 10 no 132 *
!* 12 no 12 yes 12 yes 12 no 158 *
!* 13.2 no 13.2 yes 13.2 no 168 *
!* 16.5 no 16.5 no 16.5 no 16.5 no 216 *
!* 5 yes 5 yes 5 no 66 *
!* 6 yes 6 yes 6 no 79 *
!* 6.6 yes 6.6 no 84 *
!* 8.25 yes 8.25 yes 8.25 no 108 *
!* *
!*****************************************************************
$!
$SET TERM/DEV=VT100
$SET TERM/SCOPE
$SET TERM/NOBROADCAST
$FF[0,7] = 12
$ESC[0,7] = 27
$W = "WRITE SYS$OUTPUT"
$VT100 = "''ESC'<"
$DBLHI1 = "''VT100'''ESC'#3"
$DBLHI2 = "''VT100'''ESC'#4"
$DBLWIDE = "''VT100'''ESC'#6"
$NOATTRBTS = "''VT100'''ESC'[0m"
$REVERSE = "''VT100'''ESC'[7m"
$COL80 = "''VT100'''ESC'[?3l"
$COPY = "COPY"
$W COL80,"''ESC'[1;73fV5 4/85"
$W DBLHI1," Personal Printer Spooling Utility"
$W DBLHI2," Personal Printer Spooling Utility"
$W " "
$PTYPES = "LA34 LA36 LA50 LA100LA120LQP02Xwide"
$PTCH1 = "10"
$PTCH2 = "12"
$PTCH3 = "13.2"
$PTCH4 = "16.5"
$PTCH5 = "5"
$PTCH6 = "6"
$PTCH7 = "6.6"
$PTCH8 = "8.25"
$MAXCOLMNS = "132158168216066079084108"
$QUALD = "Draft"
$QUALL = "Letter"
$!
$GET_PRINTER_TYPE:
$ IF P1 .GE. 1 .AND. -
P1 .LE. 7 -
THEN $GOTO GET_HORIZONTAL_PITCH
$ W "''ESC'[5;1f A) Choose the # of the printer type that is connected to your terminal: _"
$ W " "
$ W " 1) LA34 2) LA36 3) LA50 4) LA100 5) LA120 6) LQP02 7) Xwide"
$ INQUIRE/NOPUN P1 "''ESC'[5;74f"
$ GOTO GET_PRINTER_TYPE
$!
$GET_HORIZONTAL_PITCH:
$ IF P2 .GE. 1 .AND. -
P2 .LE. 8 -
THEN $GOTO DRAFT_OR_LETTER
$ W "''ESC'[9;1f B) Choose the # of the horizontal pitch (char/inch) that you require: _"
$ W " "
$ W " 1) 10 2) 12 3) 13.2 4) 16.5 5) 5 6) 6 7) 6.6 8) 8.25"
$ INQUIRE/NOPUN P2 "''ESC'[9;72f"
$ GOTO GET_HORIZONTAL_PITCH
$!
$DRAFT_OR_LETTER:
$ IF P3 .EQS. "D" .OR. -
P3 .EQS. "L" -
THEN $GOTO GET_FILE_SPEC
$ W "''ESC'[13;1f C) Do you want Draft or Letter quality printing? (D or L): _"
$ INQUIRE/NOPUN P3 "''ESC'[13;61f"
$ GOTO DRAFT_OR_LETTER
$!
$GET_FILE_SPEC:
$ IF P4 .NES. "" THEN $GOTO GET_NUMBER_COPIES
$ W "''ESC'[14;1f''ESC'[J"
$ W "''ESC'[15;1f D) Enter file specification you want printed: ______________________________"
$ INQUIRE/NOPUN P4 "''ESC'[15;48f"
$ IF P4 .EQS. "PSETUP" THEN $GOTO PRINTER_SETUP_AND_EXIT
$ GOTO GET_FILE_SPEC
$!
$GET_NUMBER_COPIES:
$ IF P5 .NES. "" THEN GOTO SETUP_FOR_PRINTING
$ W "''ESC'[16;1f''ESC'[J"
$ W "''ESC'[17;1f E) Enter the # of copies you want to print <1>: _"
$ INQUIRE/NOPUN P5 "''ESC'[17;50f"
$ NO_FF = "FALSE"
$ IF P5 .EQS. "NFF" THEN NO_FF = "TRUE"
$ IF NO_FF .EQS. "TRUE" THEN P5 = 1
$ IF P5 .EQ. "" THEN P5 = 1
$!
$SETUP_FOR_PRINTING:
$ PTOFFSET = P1 * 5 - 5
$ PRNTRDEV = F$EXTRACT('PTOFFSET',5,PTYPES)
$ SUMMARY1 = ""
$ SUMMARY2 = ""
$ IF P5 .EQ 1 THEN $GOTO SET_1_COPY_SUMMARY
$ SUMMARY1 = P5 + " Copies of the file " + P4 + " will print on your " + PRNTRDEV + "."
$ SUMMARY2 = "The file will print at a " + PTCH'P2' + " char/inch pitch with " + QUAL'P3' + " quality ."
$ GOTO DISPLAY_SUMMARY
$!
$SET_1_COPY_SUMMARY:
$ SUMMARY1 = "A single copy of the file " + P4 + " will print on your " + PRNTRDEV + "."
$ SUMMARY2 = "The file will print at a " + PTCH'P2' + " char/inch pitch with " + QUAL'P3' + " quality ."
$!
$DISPLAY_SUMMARY:
$ W "''ESC'[19;5f",REVERSE,SUMMARY1,NOATTRBTS
$ W "''ESC'[20;5f",REVERSE,SUMMARY2,NOATTRBTS
$ IF PRNTRDEV .EQS. "LA50 " .OR. -
PRNTRDEV .EQS. "Xwide" -
THEN $PRNTRDEV = "LA100"
$ SET TERM/DEV='PRNTRDEV'/WIDTH=132
$ MCOFFSET = P2 * 3 - 3
$ MAXCOLMN = F$EXTRACT('MCOFFSET',3,MAXCOLMNS)
$ IF P1 .EQ. 7 -
THEN $SET TERM/WIDTH='MAXCOLMN'
$ PRINT_CONTROL = "''ESC'[5i''ESC'[6i"
$ PRINT_CONTROL = PRINT_CONTROL + "''ESC'[''P2'w"
$ IF P3 .EQS. "D" -
THEN $PRINT_CONTROL = PRINT_CONTROL + "''ESC'[0""z"
$ IF P3 .EQS. "L" -
THEN $PRINT_CONTROL = PRINT_CONTROL + "''ESC'[2""z"
$ W PRINT_CONTROL
$ COPY_COUNT = 0
$!
$COPY_LOOP:
$ COPY_COUNT = COPY_COUNT + 1
$ ON ERROR THEN $GOTO ERROR_ON_COPY
$ COPY 'P4' TT:
$ IF NO_FF .EQS. "FALSE" THEN W FF
$ IF COPY_COUNT .EQ. P5 THEN $GOTO END_OF_COPY
$ GOTO COPY_LOOP
$!
$ERROR_ON_COPY:
$ PRINT_CONTROL = "''ESC'[0""z" + "''ESC'[1w" + "''ESC'[4i" + "''ESC'[7i"
$ W PRINT_CONTROL
$ SET TERM/DEV=VT100
$ COPY_COUNT = 0
$ ERRMSG1 = ""
$ ERRMSG2 = ""
$ ERRMSG1 = "The file " + P4 + " does not appear to exist."
$ ERRMSG2 = "Please double check your output file specification."
$ W "''ESC'[19;5f''ESC'[0J"
$ W "''ESC'[19;5f",REVERSE,ERRMSG1,NOATTRBTS
$ W "''ESC'[20;5f",REVERSE,ERRMSG2,NOATTRBTS
$ P4 = ""
$ P5 = ""
$ COPY_COUNT = 0
$ W "''ESC'[22;1f Do you want to print another file? _"
$ INQUIRE/NOPUN ANS "''ESC'[22;40f"
$ GOTO CONTINUE_AFTER_ERROR
$!
$END_OF_COPY:
$ PRINT_CONTROL = ""
$ IF NO_FF .EQS. "FALSE" THEN PRINT_CONTROL = FF
$ PRINT_CONTROL = PRINT_CONTROL + "''ESC'[0""z" + "''ESC'[1w" + "''ESC'[4i" + "''ESC'[7i"
$ W PRINT_CONTROL
$ SET TERM/DEV=VT100
$ P4 = ""
$ P5 = ""
$ COPY_COUNT = 0
$ W "''ESC'[22;1f Do you want to print another file? _"
$!
$INPUT_ANS:
$ INQUIRE/NOPUN ANS "''ESC'[22;40f"
$!
$CONTINUE_AFTER_ERROR:
$ IF ANS .EQS. "N" .OR. -
ANS .EQS. "" -
THEN $GOTO RESET_TERMINAL
$ IF ANS .EQS. "Y" -
THEN $GOTO GET_PRINTER_TYPE
$ IF ANS .EQS. "A" -
THEN $P1 = ""
$ IF ANS .EQS. "B" -
THEN $P2 = ""
$ IF ANS .EQS. "C" -
THEN $P3 = ""
$ GOTO INPUT_ANS
$!
$RESET_TERMINAL:
$ SET TERM/DEV=VT100
$ SET TERM/BROADCAST
$ W COL80
$ W DBLWIDE,"PPSU exited"
$ IF VERIFYFLG THEN $SET VERIFY
$ EXIT
$!
$PRINTER_SETUP_AND_EXIT:
$!
$! set up characteristics and exit
$!
$ PTOFFSET = P1 * 5 - 5
$ PRNTRDEV = F$EXTRACT('PTOFFSET',5,PTYPES)
$ IF PRNTRDEV .EQS. "LA50 " .OR. -
PRNTRDEV .EQS. "Xwide" -
THEN $PRNTRDEV = "LA100"
$ SET TERM/DEV='PRNTRDEV'/WIDTH=132
$ MCOFFSET = P2 * 3 - 3
$ MAXCOLMN = F$EXTRACT('MCOFFSET',3,MAXCOLMNS)
$ IF P1 .EQ. 7 -
THEN $SET TERM/WIDTH='MAXCOLMN'
$!
$! ESC[4i - Turn off data from host to printer port
$! ESC[5i - Turn on data from host to printer port
$! ESC[6i - Turn off data from host to screen
$! ESC[7i - Turn on data from host to screen
$!
$ PRINT_CONTROL = "''ESC'[5i''ESC'[6i"
$ PRINT_CONTROL = PRINT_CONTROL + "''ESC'[''P2'w"
$ IF P3 .EQS. "D" -
THEN $PRINT_CONTROL = PRINT_CONTROL + "''ESC'[0""z"
$ IF P3 .EQS. "L" -
THEN $PRINT_CONTROL = PRINT_CONTROL + "''ESC'[2""z"
$ SUMMARYP = "Printer now set at " + PTCH'P2' + " char/inch pitch with " + QUAL'P3' + " quality."
$ W PRINT_CONTROL
$ W SUMMARYP
$ W FF,"''ESC'[7i","''ESC'[4i"
$ GOTO RESET_TERMINAL
$!
T.R | Title | User | Personal Name | Date | Lines
|
---|