home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 September
/
Simtel20_Sept92.cdr
/
msdos
/
printer
/
setprint.arc
/
SETPRINT.DOC
< prev
Wrap
Text File
|
1988-02-29
|
2KB
|
39 lines
ANOTHER WAY TO SET PRINTER OPTIONS BY PC Magazine-Power User Column Oct.29,1985
In a recent Power User column you presented a number of interesting ways to
send command sequences to the printer. Here's another, which uses DOS's ability
to redirect ECHO statements in batch files to the printer. For example, if your
batch file contains
ECHO string > lpt1
the character string "string" will be printed on the default printer. You can
send printer command sequences by specifying them as "string". All you need is
an editor (such as IBM Personal Editor, Microsoft Word, or XyWrite II-Plus)
that lets you enter the Escape character (ASCII 27) and other nonprinting ASCII
characters.
The SETPRINT batch program shown is designed to set the options I normally
use with an Okidata Microline printer. If you don't enter any parameters on
SETPRINT's command line, a help screen is presented (see the label :HELP) that
tells you which parameters are valid and what they do.
SETPRINT will send any number of valid options to your printer. You just
type in the sequences you want sent.
William Perry
Blacksburg, Virginia
SETPRINT.BAT works fine and demonstrates once again that there are more ways to
set up a printer than to skin the proverbial cat. To show SETPRINT in this col-
umn, all characters that are to be directed to the printer are printed inside
braces ({ }). Except for the Escape character, which is listed as {esc}, non-
printing codes are shown as a-xxx, where the notation xxx represents the ASCII
code, and "a-" means that you should use the Alt key in conjunction with the
numeric keypad to enter the number.
As an alternative to using an editor to generate the ECHO statements, you
might use a short BASIC program that prints them to a file. Such a program wou-
ld contain statements such as:
PRINT #1, "echo "+chr$(27)
where file number 1 is the open file.