home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Share Gallery 1
/
share_gal_1.zip
/
share_gal_1
/
BF
/
BF186.ZIP
/
LPTX.DOC
< prev
next >
Wrap
Text File
|
1990-09-27
|
16KB
|
389 lines
LPTx : Line Printer Output Capture Routine
------------------------------------------------------------------------
Version 8.00/8.00a Beta
(C) Copyright 1990 by Mark C. DiVecchio, All Rights Reserved
Author : Mark C. DiVecchio
DISCLAMER : This program tries to perform a function which is not supported
by DOS. It will work sometime and will not work other times. That kind of
explains why you don't see this type of program on the market.
-----------------------
User-Supported Software
-----------------------
This program and documentation are copyrighted by Mark C. DiVecchio.
Permission to copy:
Individuals, clubs and other non-profit organizations are granted
permission by the author to freely copy this program and documentation
and share it with their members, so long as:
- No price is charged for the software or documentation.
However, a distribution cost may be charged for the cost of
the diskette, so long as it is not more than $9 total.
- Club members are informed of the user-supported concept and
encouraged to support it with their copyright fees.
- The program and documentation are not modified in any way
and are always distributed together.
Schools, universities, and other non-profit organizations are granted
permission by the author to copy LPTx for use on other computers and at
other locations in the organization, so long as:
- The full fee of $25 has been paid for the original copy of
the program.
- A usage fee of $40 is paid for each additional building
where LPTx will be used. Within each building for which
the usage fee has been paid, LPTx may be copied freely for
use on any other computer in that building. Contact the
author if you would like to make other arrangements.
Commercial users of this program are required to submit the copyright
fee. Commercial and site licenses as well as source code licenses are
available. Contact the author.
The User-Supported concept:
User-Supported Software
If you are using this program and find it to be of value, your copyright
fee will be appreciated. ($25 is suggested)
Mark C. DiVecchio
9888 Carroll Center Road, Suite 113
San Diego, CA 92126
619-549-4056
Regardless of whether you pay the copyright fee, you are encouraged to
use, copy and share this program.
User-supported software is an experiment in distributing computer
programs, based on these beliefs:
- That the value and utility of software is best assessed by
the user on his/her own system.
- That the creation of personal computer software can and
should be supported by the computing community.
- That copying of programs should be encouraged, rather than
restricted.
Anyone may request a copy of a user-supported program by sending a blank
double sided double density, 360Kb formatted disk (without DOS) to the
author of the program. An addressed, postage-paid return mailer must
accompany the disk (no exceptions, please). A copy of the program, with
documentation on the disk, will be sent by return mail. The program will
carry a notice suggesting the payment of a copyright fee to the
program's author. Paying that copyright fee is completely voluntary on
the part of each non-commercial user. You can also call my BBS at
619-549-3927 for the latest news.
Free distribution of software and voluntary payment for its use
eliminates costs for advertising and copy protection schemes.
Users obtain quality software at reduced cost. They can try it out
before buying, and do so at their own pace and in the comfort of their
own home or office. The best programs will survive, based purely on
their quality and usefulness.
Please join the experiment.
If you believe in these ideals, the copyright fee is solicited to help
make them work.
Mark C. DiVecchio
9888 Carroll Center Road, Suite 113
San Diego, CA 92126
619-549-4056
Athena Systems BBS : 619-549-3927
------------------------------------------------------------------------
------------------------------------------------------------------------
------------------------------------------------------------------------
Version 8.00
(C) Copyright 1990 by Mark C. DiVecchio, All Rights Reserved
(C) Copyright 1987 by Kepa Zubeldia, All Rights Reserved
DISCLAMER : This program tries to perform a function which is not
supported by DOS. It will work sometime and will not work other times.
That kind of explains why you don't see this type of program on the
market. I have tested it under 3.1 and 3.3. I have not tested it under
DOS 4.x.
------------------------------------------------------------------------
First - some thanks... I would like to thank all of the users who have
called me about the earlier versions of LPTx which has been floating
around for about three years. The program has met with mixed success.
There seems to be no pattern as to when the program works and when it
doesn't. I am still searching for the solution to this very difficult
problem. This version and the versions which preceded it are attempts to
perform the same function with a different algorithm. versions 3.00,
4.00, 5.00, 6.00, and 8.00 are not replacements or upgrades of each
other but just alternative implementations. Version 7.00 is version 6.00
with a pop-up window.
A special word of Thanks to Kepa Zubeldia who added the popup window
enhancements for version 7.00 which were carried forward to later
versions.
Version 8.00 has benefited from a really good article ( # 11 ) on TSR's
in 'The MS-DOS Encyclopedia'. and from an article by Tom Kihlken in Vol
6 No 22 of PC Magazine.
------------------------------------------------------------------------
Have you ever wanted to get some data from your screen into a program?
Have you ever wanted to grab onto some printer data and put it into a
disk file but the program you are using does not have that as a option?
Well here is the answer to your problem. This program will grab onto
anything sent out of a line printer port as long as the program uses the
standard BIOS INT 17h call. This version works with Shift-PrtSc or
Ctrl-PrtSc but does not work with the DOS TYPE command.
This program intercepts the BIOS interrupt 17h, the line printer
interrupt. It will redirect the output of LPT1, LPT2, or LPT3 to a disk
file. All three redirections may be active at the same time.
This version of LPTx counts on the PC having some "free time" in order
to write the data to disk. The program gathers data into a large buffer
and during timer interrupts and keyboard idle periods, it writes it to
disk. DOS must not be in its critical section for the write to take
place. LPTx does not work with the DOS TYPE apparently because the
critical section flag is always set when the timer interrupts occur. It
should work with most user programs since the critical section flag is
not set in user programs and therefore will not be set when timer
interrupts occur.
If you would like the other versions of LPTx, I will be happy to send
them to you. Just send me a formatted 360K DSDD floppy (no DOS on
diskette) along with a post-paid, self-addressed floppy mailer. I will
send you all current versions that are active. If you received this disk
directly from me, all of the different versions are already on the
diskette. You can also call my BBS at 619-549-3927.
LPTx versions 3.00-7.00 requires DOS 2.0 or later. LPTx version 8.00
requires DOS 3.0 or later.
Calling sequence:
lptx [-?] [-m] [-s] [-l] [-i] {-1,-2,-3} {[-c] [-o] [-a] [<d:[pathname]filename>]}
Note: -1, -2, and -3 are mutually exclusive
-o, -a, and -c are mutually exclusive
Where:
-1 means redirect LPT1, -2 means redirect LPT2, -3 means redirect LPT3.
This option must appear before -c, -o or -a.
-o means start the redirection to file specified.
If redirection is already in progress for the selected line printer, the
old file will be closed first. (If you do not specify -o but you do
specify a line printer, LPTx will use either the last file name that you
gave when you loaded LPTx or will use the file named LPTXy.LST which it
will create in the root directory on the default drive - where y is 1,
2, or 3.)
It is not necessary that you specify the complete path name for the
file. LPTx will create the file in the default directory if you don't
specify a directory. LPTx will always be able to find the file because
it saves the complete path.
If you just specify a filename, LPTx will assume -1 and -o.
If the file already exists, LPTx asks if you want to overwrite it. You
can answer :
y LPTx overwrites the file
a LPTx appends to the file (just like -a option)
q or anything else
Terminates LPTx
-a means the same as -o except that if there is a file with the same
name already on the disk, LPTx will append the text to that file without
asking the user for confirmation. In order for this to work properly,
the file on the disk must NOT be terminated by a control-Z (1Ah).
Otherwise you may not be able to see the text that will be appended
after the control-Z.
LPTx will not put a control-Z at the end of its files. If you need a
control-Z at the end, you can use the copy command, with the
concatenation option (copy x+y z) to add a control-Z. See your DOS
manual.
-c means close the file and send all further output directly to the line
printer.
If neither the -o or the -c option is specified and a filename is not
given, LPTx just displays the program status.
-? displays a short help screen.
-l tells LPTx to strip linefeed characters from the data as it is being
redirected.
-i removes LPTx from the interrupt chain. This effectively inactivates
the program. The memory which it occupies is freed if possible.
-m the first time LPTx is run, tells the pop-up window to ignore the
color card and use monochrome attributes. Makes a more readable screen
on monochrome monitors with graphics adapter cards.
-s : normally, LPTx runs quietly. This option causes it to beep and honk
as follows :
4 beeps on a disk error. LPTx terminates redirection
1 beep on each successful write to disk
1 honk on the queuing of a disk write request
LPTx always generates 2 beeps on a buffer overflow and terminates
redirection
examples:
lptx Displays the program status
lptx -? Displays a HELP screen
lptx -1 redirects LPT1 output to file named
PTX1.LST in the root directory
on the default drive or the last
named file.
lptx -o a:\able.xxx redirects LPT1 output to file named
or a:\able.xxx. Any open redirection
lptx a:\able.xxx disk file for LPT1 is closed.
lptx -2 b:xx.lst redirects LPT2 output to file named
XX.LST in the default directory
on drive B:. Any open redirection
disk file for LPT2 is closed.
lptx -3 d:\ab\cd\file.lst redirects LPT3 output to the file named
file.lst in the directory ab\cd on drive
d:.
lptx -c closes any disk files open for LPT1 and sends
or the output back to the line printer
lptx -1 -c If no redirection is taking place to LPT1,
this is a NOP. LPT2 and LPT3 are not
affected.
lptx -2 -c closes any disk file open for LPT2 and
sends the output back to line printer.
if no redirection is taking place to LPT2,
this is a NOP. LPT1 and LPT3 are not
affected.
lptx -i LPTx is unhooked from the interrupt chain
and removed from memory if possible.
By redirecting LPT2 or LPT3 to a disk file, you can in effect have 2 or
3 printers on your system. LPT1 can be your physical printer and you can
have LPT2 output going to disk. When you redirect LPT2 or LPT3, LPT1
works normally.
If you are redirecting to a diskette file, do not remove the diskette
once the redirection starts. I recommend redirecting to a hard disk or a
RAM disk.
If LPTx encounters any kind of error during the redirection, it
terminates operation and sends output back to the line printer. It does
not display anything but beeps the speaker. Four beeps indicates a DOS
disk access error. Two beeps indicates an internal buffer overflow
error. This prevents your currently running program from possibly
getting destroyed. An error with LPT1 redirection does not shut down
LPT2 or LPT3 redirection.
LPTx captures the int 17h interrupt vector. Problems may occur with
print spoolers which also take over the int 17h vector. You can be sure
that LPTx works correctly by running LPTx before you run your print
spooler. LPTx will be transparent to the print spooler but your print
spooler may not be transparent to LPTx. LPTx works fine with IBM's PRINT
command.
LPTx also captures the int 24h critical error interrupt vector. This is
done only for the period that LPTx is using the disk. This prevents the
generation of funny error messages in the middle of other programs that
you may be running. (LPTx just beeps 4 times and clears itself out of
way if a disk error occurs).
This version of LPTx can redirect all three printers to three different
files with all 3 active at the same time.
LPTx worked correctly when I tested it with:
1. WordPerfect 5.1
2. the PKUNZIP utility with the "-pa1" option
and output redirected to prn
3. shift PrtSc
4. DOS PRINT utility
5. Lotus 123 Release 3.0
6. Finalword 2.00
LPTx did not work with:
1. ctrl PrtSc followed by the DOS 'type' command
2. copy <file> prn
3. type <file> >prn
Generally it does not work with built in DOS commands when
the output generated is more than 4096 bytes. What happens is
that DOS is continually busy and does not permit LPTx to empty
its buffer.
If you find any bugs in this program, I would appreciate it if you would
drop me a line and let me know. Use the address above or the BBS.
Updates and new versions of this program can be found on the Athena
Systems BBS at 619-549-3927.
Versions 7.00 and later contain code for a pop-up window that allows the
user to turn the redirection ON or OFF from within an application
program. This window has been tested with Monochrome, Color, and EGA
adapter cards, and with monochrome and color monitors. If DOS is busy
when you try to open the window, you will get no response. In that case,
press Alt-PrtSc again until the window opens. You can only redirect
printers to files that have been previously opened with the command
line version of LPTx.
For Example :
You first must start LPTx from the command line as usual :
lptx output.fil
Then you can press Alt-PrtSc and a pop-up window will appear. When it
does, the up and down arrow keys select a printer and the right and left
arrow keys select redirection. The pop-up will state "to file" or "to
printer" indicating the state of the redirection.
Press <Enter> or <Esc> to close the window.
Remember that you must start LPTx from the command line before the
pop-up will let you turn redirection on or off.
Another change in LPTx version 7.00 is the capability of appending to an
existing file, instead of having to use a new file every time. This
feature forced the sacrifice of the control-Z added at the end of the
file.
Version 8.00 is a further upgrade in performance and comes in two
flavors. Version 8.00 is the traditional 3 printer support version each
with 4K buffers. Version 8.00a is 1 printer version with a single 40K
buffer.
Version 8.00 uses features found only on DOS 3.0 and later versions of
DOS. It will not run under earlier versions.