home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
assemblr
/
library
/
sampler0
/
printer.doc
< prev
next >
Wrap
Text File
|
1986-03-01
|
10KB
|
216 lines
PRINTER.DOC Ver 1.1
John Petrey
(c) 1983
This is the documentation file for the PRINTER.COM program, a
program that allows one to easily use the special print functions
for their printer (any make). PRINTER.COM is run by typing in
PRINTER at the DOS prompt or directly from Wordstar using the "R"
(run a program) command.
PRINTER.COM is used to set up your printer to make use of it's
special print functions (compressed print, double strike print,
italics print, etc.) For example, you may have a printer that
normally only prints 80 characters on a line, which is fine most
of the time. However, you may find times when you'd like to
print more than 80 characters on a line. You can use PRINTER.COM
to tell your printer to use compressed print. Likewise, if you
normally use continuous form paper, then you want the printer to
stop printing when it runs out of paper. But when you want to
use single sheet paper, the printer stops because it thinks it
doesn't have any paper in the printer. PRINTER.COM can tell the
printer to temporarily ignore the paper out sensor so you can use
single sheet paper. Whatever your printer has the capability to
do, you can easily do it with PRINTER.COM.
To use PRINTER.COM you must set up a data file for PRINTER.COM to
read so it knows what special print functions you want to use.
You can enter up to ten different special print features in the
data file. The data file must be named PRINTER.DAT and must
conform to a specific format so PRINTER.COM can understand it.
When you run PRINTER.COM, it looks for the PRINTER.DAT file on
the default disk drive unless you tell PRINTER.COM that the DAT
file is located on some other disk drive. You tell PRINTER.COM
the drive the DAT file is located on by typing in the disk drive
letter after you type in PRINTER at the DOS prompt. For example,
if the default drive is A and PRINTER.COM is on drive B and
PRINTER.DAT is on drive C, you would type in B:PRINTER C at the
DOS A> prompt so DOS would know to look on drive B for PRINTER.COM
and so PRINTER.COM would know to look on drive C for PRINTER.DAT.
The data file (PRINTER.DAT) must contain a description (literal)
of the special print features you want to be available and the
printer control codes for each special print feature. The
control codes are listed in your printer's user manual and are
likely found in the back of the manual as an appendix. A control
code is nothing more than a unique code that the printer
recognizes as a command to change to a special print mode.
Let's assume you have an Epson MX printer and want to be able to
set up the printer for compressed print. According to the Epson
manual (appendix B in my Epson manual) the control code to turn
on compressed print is 15 (the ASCII character 15). To set up
your PRINTER.DAT file for compressed print on an Epson printer
you would need an entry like the following:
Compressed Print$015000
Page 1
The first part of the entry is what you want printed on the
screen, Compressed Print in this case. Following the literal is
a dollar sign ($) which tells PRINTER.COM where the end of your
literal is and where the beginning of the codes are that you want
sent to the printer to turn on that special print feature.
Following the dollar sign are six digits which to PRINTER.COM are
really two three-digit numbers. The first three digits in this
case are 015 which will be sent to the printer to turn on
compressed print. The last three digits (000 in this case) will
not be sent to the printer because it is 000. PRINTER.COM
expects two three-digit numbers, so in this case we had to enter
000 as one of the two three-digit numbers to satisfy
PRINTER.COM's requirement for two three-digit numbers. Many
special print functions require two control codes be sent to the
printer in order to set up a special print function, so that is
why PRINTER.COM wants two-three digit numbers. For example, on
the Epson Printer, to set up Italics print you need to send the
printer a ESC (escape) and a 53 (according to my Epson Printer
manual, Appendix B). You would enter your literal, Italics
Print, followed by a dollar sign followed by 027053. 027 is the
ASCII code for Escape and 053 is the code for Italics. Thus,
the entry in the PRINTER.DAT file would look like:
Italics Print$027053
Up to ten different special print functions can be entered in
the PRINTER.DAT file and each should be on separate lines. The
last entry should be followed by an ampersand (&) immediately
after the last digit of the last code. The ampersand (&) tells
PRINTER.COM when it has reached the end of your special print
features. For example, if you only had two entries in your
PRINTER.DAT file it might look like:
Compressed Print$015000
Italics Print$027053&
Remember, 1) you can have up to 10 entries in PRINTER.DAT
2) each entry is comprized of:
a. literal followed by dollar sign
b. followed by two three-digit codes (decimal
ASCII value - not hex) that are to be sent
to the printer (Refer to your printer's
manual for the control codes to set up the
special print features you want to use.) If
your printer manual says to send a alpha
character to the printer, you can find out
what ASCII code should be sent by refering
to the IBM-PC BASIC manual appendix G.
3) The last digit of last code is followed by an
ampersand (&) so PRINTER.COM knows when it has
reached the last of your special print features.
Page 2
The PRINTER.DAT file can be created with any editor (Edlin,
Wordstar, directly from the console, etc.). Just be sure if you
use Wordstar that you create/edit the PRINTER.DAT file in the
non-document mode. A sample PRINTER.DAT file (for an Epson
printer) is provided as an example.
PRINTER.COM can be run from Wordstar by using the R (run a
program) command from the Wordstar Menu. For example, assume you
just finished editing a document and have saved it. You should
now be at the Opening Menu where you normally would strike P to
begin printing the document. Before printing the document, you
can strike R for run a program at which time Wordstar will ask
you for the name of the program you wish to run. Type in PRINTER
and strike the enter key. Note: if PRINTER.COM is not on the
logged (default) disk drive you'll need to prefix PRINTER with
the drive specification of the drive where Wordstar can find
PRINTER.COM (such as A: for drive A). If PRINTER.DAT is not on
the default disk drive, you'll need to specify the drive where it
can be found after entering PRINTER. For example, if the default
drive is B: and both PRINTER.COM and PRINTER.DAT are on drive A:,
then you'll need to enter A:PRINTER A so Wordstar will know
where to look for PRINTER.COM and PRINTER.COM will know where to
look for PRINTER.DAT. After you've entered this, Wordstar will
run the PRINTER.COM program which will prompt you for the special
print functions you set up in your PRINTER.DAT file. Upon
exiting PRINTER.COM, you will automatically return to Wordstar
where you can now strike P to begin printing your document with
the special print function(s) you selected in effect.
Listed below is a sample PRINTER.DAT file for an EPSON printer.
Set Printer to Power Up Mode$027064
Compressed Print$027015
Italics Print$027052
Emphasized Print$027069
Double Strike Print$027071
1/8th Inch Spacing$027048
Turn on Paper Out Sensor$027057
Turn off Paper Out Sensor$027056
Double Width Print #1$027087
Double Width Print #2$001000&
Note: To use Double Width Print, both Double Width options
in the above sample must be entered. This is because
the Epson printer needs three control codes to set up
Doulbe Width print. Since PRINTER.COM can only have
two control codes per entry in the PRINTER.DAT file,
two entries in PRINTER.DAT are required to send the
three control codes the Epson printer wants.
Page 3
three control codes the Epson printer wants.
Page 3