home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Between Heaven & Hell 2
/
BetweenHeavenHell.cdr
/
300
/
294
/
lptx.doc
< prev
next >
Wrap
Text File
|
1987-01-09
|
9KB
|
208 lines
LPTx : Line Printer Output Capture Routine
------------------------------------------------------------------------
Version 6.0B
(C) Copyright 1987 by Mark DiVecchio, All Rights Reserved
BETA RELEASE: This is a Beta release only. Source is not included until I
get back some test reports. Please don't distribute it yet but refer all
requests for the program to me. I would appreciate any feed back which you
can give me about the circumstances under which the program works and which
the program fails.
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 DOS 2.x and 3.x. In particular, under 3.x, I used dBase-II.
I have not tested it with dBase-III or dBase-III+.
Mark C. DiVecchio
10435 Mountain Glen Terrace
San Diego, CA 92131
619-566-6810
------------------------------------------------------------------------
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 a year. 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 versions 4.x and 5.x which preceeded it are attempts to perform
the same function with a different algorithm. Version 3.00, 4.00, 5.00 and
6.0B are not replacements or upgrades of each other but just alternative
implementations.
------------------------------------------------------------------------
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.
Look at the Assembly Language Source which you should have received
with this documentation file. 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.
LPTx requires DOS 2.0 or later. It has been tested on version 3.1
of DOS as well.
Calling sequence:
lptx [?] [-x] [-l] [-i] {-1,-2,-3} {-c -o <d:[pathname]filename>}
where -1 means redirect LPT1, -2 means redirect LPT2, -3 means redirect
LPT3
This option must appear first
-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.
-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, LPTx just displays
the program status.
-? displays a short help screen.
-x tells LPTx to ignore the DOS Critical Section Flag. Use this
option only with great care. LPTx may do unusual things if the
flag is ignored.
-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 not freed.
note: -1, -2, and -3 are mutually exclusive
-o and -c are mutually exclusive
examples:
lptx Displays the program status
lptx ? Displays a HELP screen
lptx -1 redirects LPT1 output to file named
LPTX1.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.
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. dBaseII,
2. the ARC utility with the "p" option and output redirected to prn,
3. shift PrtSc,
4. DOS PRINT utility,
5. Lotus 123,
6. dir > prn,
LPTx did not work with:
1. The DOS TYPE command,
2.
Version 6.0B of LPTx uses about 20K of memory for the resident data
buffers and interrupt handler. This is greater than the previous versions
of LPTx because I made the disk buffers larger.
If you modify or find any bugs in this program, I would appreciate
it if you would drop me a line with the changes. Use the address above.