In the Public Domain Number 1 by Dwight K. Illk November 30, 1986 -- Reviews and comments about Public Domain and User Supported Software for the IBM-PC and Compatibles -- (C)Copyright Dwight K. Illk 1986 -- Permission is granted for unlimited distribution for non- commercial purposes. =========================================================== PRINTER REDIRECTION UNDER PC-DOS 3.1 (1) -- A program that redirects printer output to a disk file can be quite useful. It can save paper, supplies and prin- ter wear and tear. You can "print" to a disk file now to save time and actually print the file later when it is more convenient, or perhaps, on another computer. You can debug programs that produce printed output by "printing" to a file which can then be analyzed for control characters and escape sequences that affect printed output. You can also produce files to edit with your word processor from programs that are designed to produce only printed output. Public domain authors have come through again with many programs designed to give these benefits, but I found when "upgrading" to PC-DOS v 3.1, that these programs no longer worked on my IBM-PC/XT as they had before. In general, the programs I had been using "hang" the computer the first time they write to the disk file forcing me to reach for the big red switch. I have evaluated several Public Domain (PD) programs trying to find one that "does everything". I have not been fully successful but with the combination of three such programs, LPTx v 3.0, PR2FL v 1.0 and LPT2DSK v 1.0, you can cover most, or maybe all, of the bases. -- NOTE: BOTH LPTx AND PR2FL WORK BETTER THAN DESCRIBED HERE WHEN USING DOS 2.x! -- LPTx v 3.0 was written and copyrighted by Mark DiVec- chio, a computer systems consultant in San Diego. He gives permission in the documentation to "use and freely dis- tribute this program for non-commercial applications." For the techies in the crowd, LPTx works by capturing the BIOS interrupt 17h vector for LPTn and redirecting the data to a disk file. Mark also provides the assembly code for those of you who would like to make "improvements". LPTx has many excellent features such as the ability to redirect the out- put for LPT1, LPT2 and/or LPT3 to separate files at the same time, on-line help by typing "LPTx ?", a status report by typing "LPTx", creation of default filenames if you chose not to specify your own, and giving warning before it over- writes an existing file. With LPTx, you can even TYPE the print file while the LPTx redirection is still active. If you do this, you will find that the last little bit of the file may be missing be- cause it is still in the memory buffer. LPTX worked well with all of my "memory resident" utilities loaded, and I have a bunch of them! In his efforts to improve LPTx, Mark has issued several other versions. Some of them may perform differently than the version 3.0 described here, but none of them (through version 5.0) function perfectly under DOS 3.1. (2) -- Running on a IBM-PC/XT under PC-DOS 3.1, LPTx shapes up as follows. -- On the up side: This works great! (3) DOS PRINT DOS PRINT command works fine. (e.g. "PRINT LPTx.DOC") QMODEM (4) If you use in QMODEM v. 2.3, data is correctly captured to the file. LOTUS 1-2-3 (5) Spreadsheet information sent to the printer by LOTUS 1-2-3 rel 2.0 is correctly cap- tured in the print file. -- On the down side: If you use to toggle on the printer while LPTx is active, the system hangs the first time that LPTx tries to write to disk and you must power down the computer to get going again. You can't even use to recover. When you reboot your computer, the print file WILL contain the last record written. DOS REDIRECTION If you use DOS redirection to get output to the printer, the system hangs on the first disk write (e.g. "TYPE LPTX.DOC >PRN:"). BASIC If you try to run a BASIC program that uses LPRINT commands, the system hangs as described above. dBASE III PLUS When trying to redirect printed reports from dBASE III PLUS (6) to a disk file, the system hangs. ----------------------------------------------------------- The copy of PR2FL (Print to File) that I have is v 1.0 written by Jim Kyle on May 29, 1985 and modified by Lew Paper on October 29, 1985. Jim is a SysOp of the Computer Language Magazine (CLM) SIG on the Compuserve Information Service (CIS). He says that Lew's revision is NECESSARY to handle pathnames in the file specification correctly. The assembly source code is available on the CIS CLM. PR2FL is released to the public domain without restriction. It works by redirecting the PRN: device to a file and starting a new copy of COMMAND.COM. The documentation for this program is excellent. PR2FL has the definite advantage on NOT locking up the system when it doesn't work. PR2FL does not put a ^Z end-of-file marker when it closes the print file, so there may be extra "garbage" at the end of the file when you list it. On the other hand, a ^Z in the print stream will be in- cluded in the file which may make the TYPE command stop too soon when listing the file. In general, if you try to TYPE the print file while PR2FL redirection is active, it will appear to be be empty. Again on the IBM-PC/XT using DOS 3.1, PR2FL did the following. -- On the up side: If you toggle on the printer while using PR2FL, whatever scrolls across the screen is correctly captured to the print file. BASIC Output from LPRINT statements in BASIC are correctly routed to the print file. QMODEM Output routed to the printer using the from within QMODEM is correctly sent to the print file. dBASE III PLUS Printed report output is redirected to the disk file just fine. This will be a BIG boon to many dBASE III PLUS users. -- On the down side: Output goes to the printer rather than to the print file. DOS PRINT Output goes to the printer. LOTUS 1-2-3 Output goes to the printer. DOS REDIRECTION Output redirected to >PRN: goes to the prin- ter rather than the print file. ----------------------------------------------------------- George Bouche, a professional programmer in Lubboch, Texas, modestly calls his LPT2DSK v 1.0 public domain program a very simple COBOL utility. It works by opening a buffer of up to 64K in memory, intercepting the BIOS 17h in- terrupt and invoking a new COMMAND.COM. Output for the specified printer is placed in the buffer while data directed to other printers is passed through. When you EXIT the daughter COMMAND.COM level, the buffer is written to the print file. The program had no problem running with a full compliment of memory resident utilities and never caused a system crash. LPT2DSK also offers the interesting pos- sibility of redirecting output from one printer to another printer. Testing LPT2DSK v 1.0 under the same conditions as the above programs, the following results were obtained. -- On the up side: Works great! Works great! DOS PRINT Works great! DOS REDIRECTION Works great! BASIC LPRINT Works great! (See a trend here?) LOTUS 1-2-3 Works great! QMODEM Works great! -- On the down side: dBASE III PLUS Whoops - when trying to "print" a report, dBASE reports a "Printer not ready." error message, but the system DOES NOT hang. ----------------------------------------------------------- LPT2DSK is the most versatile of the programs reviewed here. If you need to print dBASE III PLUS files, you should also get PR2FL. If you want to print files larger than 64K (could happen with graphics programs), you might want to try LPTx or PR2FL. PR2FL correctly handles most situations that LPTx does not; however, it does not correctly handle the functions that LPTx does well! I want to express my personal appreciation to George Bouche, Mark DiVecchio and Jim Kyle. Not only have they un- selfishly shared their work with the rest of us, but they were extremely informative and cooperative in helping me gather information for this article. All of the public domain and User Supported programs discussed in this article may be obtained from the Terrapin Data Systems BBS (612/623-0152). If you have written or know of a public domain program that performs these functions better than the ones described here, or you find that I have made an error (7), please leave a message on Terrapin Data Systems BBS or write me at 6924 Stratford Draw, Woodbury MN 55125. I regret that in general, I will be unable to reply to letters. --------------------- Footnotes -------------------------- (1) The IBM Personal Computer DOS Version 3.10, (C)Copyright International Business Machines Corp 1981, 1985, (C)Copyright Microsoft Corp 1981, 1985 (2) Mark is very interested in improving LPTx so that it will work correctly with DOS 3.x in all cases. He has invites anyone that has information that may help to contact him at 10435 Mountain Glen Terrace, San Diego, CA, 92131. (3) When you TYPE the file produced it is double spaced on the screen because the TYPE command uses the BIOS interrupt 10h routine which automatically adds a when a character is displayed in column 80. All lines in the screen print are 80 characters long, so the BIOS adds a to the end of each one. Then the CR> actually in the file causes a blank line. (4) Testing printer redirection programs with QMODEM is academic since it already has excellent capture to disk capabilities. QMODEM is a fine user supported communica- tions program copyrighted by The Forbin Project and John Friel III. It can be obtained from The Forbin Project BBS (612/824-8167) and the author requests a $30.00 registration fee if you like QMODEM and continue to use it. (5) LOTUS 1-2-3 is a commercial program copyrighted by Lotus Development Corporation. (6) dBASE III PLUS v 1.0 is a commercial data base management program copyrighted by Ashton-Tate. (7) I regret that I am subject to human error despite my ef- forts to avoid it and refuse to be responsible!