home *** CD-ROM | disk | FTP | other *** search
/ Phoenix CD 2.0 / Phoenix_CD.cdr / 15a / lptx700.zip / LPTX.DOC < prev   
Text File  |  1987-10-19  |  12KB  |  264 lines

  1. LPTx : Line Printer Output Capture Routine
  2.  
  3. ------------------------------------------------------------------------
  4.  
  5.  Version 7.00
  6.  
  7.  (C)    Copyright 1987 by Mark DiVecchio, All Rights Reserved
  8.  (C)    Copyright 1987 by Kepa Zubeldia,  All Rights Reserved
  9.  
  10.  
  11.  
  12. This program is released for use in non-commercial environments. I ask
  13. commercial users to register the program with a $25 copyright fee for each
  14. site (any number of users and computers) at which the program is used.
  15.  
  16. DISCLAMER : This program tries to perform a function which is not supported
  17. by DOS. It will work sometime and will not work other times. That kind of
  18. explains why you don't see this type of program on the market. I have
  19. tested it under DOS 2.x and 3.x. In particular, under 3.x, I used dBase-II.
  20. I have not tested it with dBase-III or dBase-III+.
  21.  
  22.  Mark C. DiVecchio
  23.  10435 Mountain Glen Terrace
  24.  San Diego, CA 92131
  25.  619-566-6810
  26. ------------------------------------------------------------------------
  27.  
  28.         First - some thanks...  I would like to thank all of the users who
  29. have called me about the earlier versions of LPTx which has been floating
  30. around for about a year. The program has met with mixed success. There
  31. seems to be no pattern as to when the program works and when it doesn't. I
  32. am still searching for the solution to this very difficult problem. This
  33. version and versions 4.x and 5.x which preceeded it are attempts to perform
  34. the same function with a different algorithm. Version 3.00, 4.00, 5.00 and
  35. 6.00 are not replacements or upgrades of each other but just alternative
  36. implementations. Version 7.00 is version 6.00 with a pop-up window.
  37.  
  38.     A special word of Thanks to Kepa Zubeldia who added the
  39. enhancements for version 7.00.
  40.  
  41. ------------------------------------------------------------------------
  42.  
  43.         Have you ever wanted to get some data from your screen into a
  44. program? Have you ever wanted to grab onto some printer data and put it
  45. into a disk file but the program you are using does not have that as a
  46. option? Well here is the answer to your problem. This program will grab
  47. onto anything sent out of a line printer port as long as the program uses
  48. the standard BIOS INT 17h call. This version works with Shift-PrtSc or
  49. Ctrl-PrtSc but does not work with the DOS TYPE command.
  50.  
  51.         This program intercepts the BIOS interrupt 17h, the line printer
  52. interrupt. It will redirect the output of LPT1, LPT2, or LPT3 to a disk
  53. file. All three redirections may be active at the same time.
  54.  
  55.         This version of LPTx counts on the PC having some "free time" in
  56. order to write the data to disk. The program gathers data into a large
  57. buffer and during timer interrupts and keyboard idle periods, it writes it
  58. to disk. DOS must not be in its critical section for the write to take
  59. place. LPTx does not work with the DOS TYPE apparently because the critical
  60. section flag is always set when the timer interrupts occur. It should work
  61. with most user programs since the critical section flag is not set in user
  62. programs and therefore will not be set when timer interrupts occur.
  63.  
  64.         Look at the Assembly Language Source which you should have received
  65. with this documentation file. If you would like the other versions of LPTx,
  66. I will be happy to send them to you. Just send me a formatted 360K DSDD
  67. floppy (no DOS on diskette) along with a post-paid, self-addressed floppy
  68. mailer. I will send you all current versions that are active. If you
  69. received this disk directly from me, all of the different versions are
  70. already on the diskette.
  71.  
  72.         LPTx requires DOS 2.0 or later. It has been tested on version 3.1
  73. of DOS as well.
  74.  
  75. Calling sequence:
  76. lptx [?] [-m] [-x] [-l] [-i] {-1,-2,-3} {-c -o -a <d:[pathname]filename>}
  77.  
  78. where -1 means redirect LPT1, -2 means redirect LPT2, -3 means redirect
  79.          LPT3
  80.          This option must appear first
  81.  
  82.       -o means start the redirection to file specified. If redirection
  83.          is already in progress for the selected line printer,
  84.          the old file will be closed first.
  85.          (If you do not specify -o but you do specify a line printer,
  86.          LPTx will use either the last file name that you gave when
  87.          you loaded LPTx or will use the file named LPTXy.LST which it
  88.          will create in the root directory on the default drive - where
  89.          y is 1, 2, or 3.)
  90.  
  91.          It is not necessary that you specify the complete path name
  92.          for the file. LPTx will create the file in the default 
  93.          directory if you don't specify a directory. LPTx will always
  94.          be able to find the file because it saves the complete path.
  95.  
  96.       -a means the same as -o except that if there was a file with the same
  97.          name already on the disk, it will append the text to that file
  98.          without asking the user for confirmation. In order for this to
  99.          work properly, the file on the disk must NOT be terminated by
  100.          a control-Z (1Ah). Otherwise you may not be able to see the text
  101.          that will be appended after the control-Z.
  102.  
  103.          LPTx will not put a control-Z at the end of its files. If you
  104.          need a control-Z at the end, you can use the copy command, with
  105.          the concatenation option (copy x+y z) to add a control-Z. See
  106.          your DOS manual.
  107.  
  108.         -c means close the file and send all further output directly to the
  109.          line printer.
  110.  
  111.          If neither the -o or the -c option is specified, LPTx just displays
  112.          the program status.
  113.  
  114.  
  115.         -? displays a short help screen.
  116.  
  117.         -x tells LPTx to ignore the DOS Critical Section Flag. Use this
  118.          option only with great care. LPTx may do unusual things if the
  119.          flag is ignored.
  120.  
  121.         -l tells LPTx to strip linefeed characters from the data as it is
  122.          being redirected.
  123.  
  124.         -i removes LPTx from the interrupt chain. This effectively inactivates
  125.          the program. The memory which it occupies is not freed.
  126.  
  127.         -m the first time LPTx is run, tells the pop-up window to ignore
  128.          the color card and use monochrome attributes. Makes a more readable
  129.          screen on monochrome monitors with graphics adaptor cards.
  130.         
  131. note: -1, -2, and -3 are mutually exclusive
  132.         -o and -c are mutually exclusive
  133.  
  134. examples:
  135.  
  136. lptx                            Displays the program status
  137.  
  138. lptx ?                          Displays a HELP screen
  139.  
  140. lptx -1                         redirects LPT1 output to file named
  141.                                 LPTX1.LST in the root directory
  142.                                 on the default drive or the last
  143.                                 named file.
  144.  
  145. lptx -o a:\able.xxx             redirects LPT1 output to file named
  146.         or                      a:\able.xxx. Any open redirection
  147. lptx a:\able.xxx                disk file for LPT1 is closed.
  148.  
  149. lptx -2 b:xx.lst                redirects LPT2 output to file named
  150.                                 XX.LST in the default directory
  151.                                 on drive B:. Any open redirection
  152.                                 disk file for LPT2 is closed.
  153.  
  154. lptx -3 d:\ab\cd\file.lst       redirects LPT3 output to the file named
  155.                                 file.lst in the directory ab\cd on drive
  156.                                 d:.
  157.  
  158. lptx -c                         closes any disk files open for LPT1 and sends
  159.         or                      the output back to the line printer
  160. lptx -1 -c                      If no redirection is taking place to LPT1,
  161.                                 this is a NOP. LPT2 and LPT3 are not
  162.                                 affected.
  163.  
  164. lptx -2 -c                      closes any disk file open for LPT2 and
  165.                                 sends the output back to line printer.
  166.                                 if no redirection is taking place to LPT2,
  167.                                 this is a NOP. LPT1 and LPT3 are not
  168.                                 affected.
  169.  
  170.         By redirecting LPT2 or LPT3 to a disk file, you can in effect have
  171. 2 or 3 printers on your system. LPT1 can be your physical printer and you
  172. can have LPT2 output going to disk. When you redirect LPT2 or LPT3, LPT1
  173. works normally.
  174.  
  175.         If you are redirecting to a diskette file, do not remove the
  176. diskette once the redirection starts. I recommend redirecting to a hard
  177. disk or a RAM disk.
  178.  
  179.         If LPTx encounters any kind of error during the redirection, it
  180. terminates operation and sends output back to the line printer. It does not
  181. display anything but beeps the speaker. Four beeps indicates a DOS disk
  182. access error. Two beeps indicates an internal buffer overflow error. This
  183. prevents your currently running program from possibly getting destroyed. An
  184. error with LPT1 redirection does not shut down LPT2 or LPT3 redirection.
  185.  
  186.         LPTx captures the int 17h interrupt vector. Problems may occur with
  187. print spoolers which also take over the int 17h  vector. You can be sure
  188. that LPTx works correctly by running LPTx before you run your print
  189. spooler. LPTx will be transparent to the print spooler but your print
  190. spooler may not be transparent to LPTx. LPTx works fine with IBM's PRINT
  191. command.
  192.  
  193.         LPTx also captures the int 24h critical error interrupt vector.
  194. This is done only for the period that LPTx is using the disk. This prevents
  195. the generation of funny error messages in the middle of other programs that
  196. you may be running. (LPTx just beeps 4 times and clears itself out of way
  197. if a disk error occurs).
  198.  
  199.         This version of LPTx can redirect all three printers to three
  200. different files with all 3 active at the same time.
  201.  
  202.         LPTx worked correctly when I tested it with:
  203.  
  204.         1. dBaseII,
  205.  
  206.         2. the ARC utility with the "p" option and output redirected to prn,
  207.  
  208.         3. shift PrtSc,
  209.  
  210.         4. DOS PRINT utility,
  211.  
  212.         5. Lotus 123,
  213.  
  214.         6. dir > prn,
  215.  
  216.         LPTx did not work with:
  217.  
  218.         1. The DOS TYPE command,
  219.  
  220.         2. The DOS COPY command,
  221.  
  222.         3.
  223.  
  224.         Version 6.00 of LPTx uses about 20K of memory for the resident data
  225. buffers and interrupt handler. This is greater than the previous versions
  226. of LPTx because I made the disk buffers larger.
  227.  
  228.         If you modify or find any bugs in this program, I would appreciate
  229. it if you would drop me a line with the changes. Use the address above. 
  230.  
  231.         Updates and new versions of this program can be found on the RBBS
  232. at 619-741-3412.
  233.  
  234.         Version 7.00 contains the code for a pop-up window that allows the
  235. user to turn the redirection ON or OFF from within an application program.
  236. This window has been tested with Monochrome, Color, and EGA adaptor cards,
  237. and with monochrome and color monitors. If DOS is busy when you try to open
  238. the window, you will get no response. In these cases, hold down Alt-PrtSc
  239. until the window opens. You can only redirect printers to files that have 
  240. been previously opened with the command line version of LPTx. 
  241.  
  242. For Example :
  243.  
  244.     You first must start LPTx from the command line as usual :
  245.  
  246. lptx output.fil
  247.  
  248.     Then you can press Alt-PrtSc and a pop-up window will appear.
  249. When it does, the up and down arrow keys select a printer and the
  250. right and left arrow keys select redirection. The pop-up will state
  251. "to file" or "to printer" indicating the state of the redirection.
  252.  
  253.     Press <Enter> or <Esc> to close the window.
  254.  
  255.     Remember that you must start LPTx from the command line before
  256. the pop-up will let you turn redirection on or off.
  257.  
  258.  
  259.         Another change in LPTx version 7.00 is the capability of appending
  260. to an existing file, instead of having to use a new file every time. This
  261. feature forced the sacrifice of the control-Z added at the end of the file.
  262.  
  263. Version 7.00 now assembles under Microsoft 5.0
  264.