T.R | Title | User | Personal Name | Date | Lines |
---|
166.1 | Can't use PRT: | NOVA::ARNOLD | | Mon Nov 10 1986 12:19 | 9 |
| I believe the LPRINT command uses the PRT: device. You cannot
send ESC characters through this device, it just throws them
away. However, you can send any character codes you want
through either the SER: (serial) or PAR: (parallel) devices.
Use the OPEN command in BASIC to open one of these devices
for output, then do a PRINT to the channel specified in
the open command.
-Jeff
|
166.2 | Could be messy | APOLLO::BERKSON | | Mon Nov 10 1986 13:05 | 5 |
| I was hoping that I would be able to send the commands through
Preferences which probably means sending them through PRT:
I wanted to send the ESC character to Prefernces and have it deal
with the printer. Isn't it possible to do that somehow without sending
raw stuff out to the printer?
|
166.3 | OPEN! | AUTHOR::MACDONALD | CUP/ML | Mon Nov 10 1986 13:21 | 7 |
| What you have to do is OPEN PRT: as you would a sequential file
for output. Then do a PRINT#n,[your printer control string here]
where n is the file number you assigned to PRT: in the OPEN statement.
That's the only way to do it that I know of. LPRINT sure won't work.
Paul
|
166.4 | Ignore Your Printer's Manual | TLE::RMEYERS | Randy Meyers | Mon Nov 10 1986 16:27 | 38 |
| I think that your problem is that the PRT: device handles its own
escape sequence processing.
I don't have any documentation in front of me so I am going to
have to be sketchy.
The PRT: device has a lot of escape sequences built into it. You
will find a list somewhere in the documentation. When the PRT:
device receives one of its escape sequences, it converts the escape
sequence to whatever commands necessary to the physical printer
to accomplish the indicated function. For example, assume that
the escape sequence for the PRT: device to do a reverse linefeed
is $[A. Assume in preferences that you selected the FOOwriter-100
as your printer, and that FOOwriters do a reverse linefeed when
you send a $(Z. Then, you should write all your programs to
do send an $[A when they want to do a reverse linefeed. The
PRT: driver converts the $[A to a $(Z before sending it to
FOOwriter.
The problem is that I don't know what happens when you send an
escape sequence that the PRT: device doesn't support. It could
very well eat it. The other danger is that the escape sequence
for shadow printing for your printer could be the sequence for
clear margins for the PRT: device.
Try and find the table that lists the escape sequences supported
by the PRT: device. It may include shadow printing. If so use
the PRT: sequence, not the sequence in your printer's manual. If
the PRT: doesn't have some feature that you want, you will have
to open either SER: or PAR: directly in order to by-pass PRT:'s
escape processing. I seem to remember that the PRT: sequences
matched fairly closely to ANSI standard sequences. If the same is
true of your printer, then you will not have to change very
much of your program.
By the way, software houses for the Amiga love the PRT: escape sequence
processing. Their programs get support for a large number of printers
without them having to do any work.
|
166.5 | Try This | AUTHOR::MACDONALD | CUP/ML | Mon Nov 10 1986 22:49 | 20 |
| Here's the info you were looking for - now that I have it in front
of me:
OPEN "PRT:" FOR OUTPUT AS #4
PRINT#4,CHR$927)"#1";CHR$(27)"#5";CHR$(27)"[0;80S"
CLOSE#4
So, just open up the printer device, and output whatever printer
codes you wish using the PRINT# command. Then close the device.
That's how you do it in AmigaBasic.
From CLI you can do a similar thing using the COPY command:
COPY * TO PRT:
Next, enter your printer control <ESC> sequences and terminate with
a CTRL-\.
Paul
|
166.6 | Another try | TLE::RMEYERS | Randy Meyers | Tue Nov 11 1986 04:13 | 28 |
| I may not have been addressing your problem in my .4 reply. I thought that
your problem might have been that you didn't know of the escape sequence
handling of the PRT: device, and that you might have gotten the escape
sequence that you were using from your printer's manual, not the PRT:
documentation. I apologize if my .4 reply bored you with lots of information
you already knew.
Anyway, I just checked my ROM Kernal Manual and your .0 message does
describe the correct escape sequence for shadow printing on.
Furthermore, the Basic manual does claim that LPRINT writes its output
to the PRT: device, and PRT: does handle the escape sequence processing.
So, I don't see why things don't work with LPRINT. I don't understand
why explicitly opening PRT: and using PRINT # should have any different
results (unless of course the BASIC manual is wrong about LPRINT using
the PRT: device instead of the PAR: device, say).
There is something that could be causing your problem that would allow
all the documentation to be right. Let me ask you a question: What
printer handler are you using? I just looked at preferences, and I didn't
see your printer listed. Are you using a handler that you got from
someone else, or are you using a handler that is for a printer similar
to yours? It is possible that the printer handler you are using doesn't
implement shadow mode. (I remember reading recently a posting to
net.micro.amiga by the author of the printer drivers for the Amiga. He
said that if a printer didn't have a particular feature, that its handler
would quietly ignore the escape sequence for that feature.)
|
166.7 | LPT: doesn't support ISO codes | AUTHOR::MACDONALD | CUP/ML | Tue Nov 11 1986 08:40 | 8 |
| I believe LPRINT opens the LPT: device. The LPT: device does not
support the ISO printer codes. For a list of the codes and an
explanation of the differences between PRT: and LPT:, see the next
to last issue of Amiga World at the very back. There is some good
info there. If you do not have a copy, send me your mailstop and
I will photocopy it for you.
Paul
|
166.8 | Thanks. Another question | APOLLO::BERKSON | | Tue Nov 11 1986 09:07 | 23 |
| Thanks for the help. The driver I set in Preferences is Diablo 630
which is what this printer uses. Both the printer and the driver
(according to the Amiga manual) support shadow printing. I was able
to turn on the shadow print by opening PAR: directly as was suggested
in a previous reply, but I'd rather go through Preferences since
that's what it's there for. LPRINTing the escape sequence doesn't
work. Maybe because of what was suggested in a previous note which
I think I read something about in the AmigaBasic manual - that LPRINT
uses LPT: (or LPT1:?).
I have another somewhat related question. In Scribble there is a
provision in the dot commands for making your own dot command in
the form .#n/m=%iii where n is the command number and iii is the
escape code. This enables the user to put in custom escape codes
(like to turn on shadow printing). If I could get this to work then
the Basic question wouldn't really be an issue even though I would
still like to find out.
For -.1 my mailstop is SHR1-3/011. I'd like to see that article.
Thanks.
mitch
|
166.9 | | ANT::SMCAFEE | Steve McAfee | Tue Nov 11 1986 09:57 | 11 |
|
I may be wrong but I think Scribble has a dot command that allows
you to insert a character of a given ascii value. This might be
the way to turn shadow mode on and off. The ascii value for ESC
is 27. You could then follow this with the rest of the text in
the sequence. I'll check the documentation tonight when I get
home if I remember.
Good luck,
Steve McAfee
|
166.10 | I think I tried that | APOLLO::BERKSON | | Tue Nov 11 1986 10:18 | 15 |
| Yes. This is what I was thinking of. To use ESC the dot command would
be .#1/0=%27
I'm not sure whether the rest of the sequence should be or can be
part of this same string. It seems like it would have to be. Otherwise
how would Scribble know where the escape sequence started and text
began? Anyway, I tried a bunch of variations on this - non of which
seemed to change the printer mode.
My understanding of the dot command above is this. The 1 after the
number sign is the command identification number to be used after
^G. The 0 after the / means the code is not printable and the %27
means ASCII 27 which is ESC.
mitch
|
166.11 | BASIC Doc Bug | TLE::RMEYERS | Randy Meyers | Tue Nov 11 1986 22:10 | 13 |
| Re .7:
I looked up the recommended article (Amiga World, September/October issue,
pages 110-111), and the author of .7 is indeed correct.
The problem seems to be a bug in the BASIC documentation. The BASIC manual
says on page 5-2 that LPT1: "is the same as the PRT: device." The Amiga
world article points out that this isn't true: LPT1: does not handle the
PRT: escape sequences.
Note that you do not have to use PAR: to send the escape sequences to the
printer--You can do an explicit open on PRT: and thus get the advantage of
the device independent escape sequences.
|
166.12 | Can I assign? | APOLLO::BERKSON | | Wed Nov 12 1986 11:50 | 3 |
| I'll try opening PRT: directly. Is there a way from CLI or BASIC
to assign LPT1: to PRT: or something like that so that the LPRINT
statements will be routed through PRT:?
|
166.13 | Why Use LPRINT????? | AUTHOR::MACDONALD | CUP/ML | Wed Nov 12 1986 13:47 | 4 |
| Praytell, why do you insist on using LPRINT? Why not use PRINT#n
where n is the number assigned to the OPENed PRT: device.
Paul
|
166.14 | OK | APOLLO::BERKSON | | Wed Nov 12 1986 14:19 | 3 |
| You're right. If the PRINT# works it won't make a difference.
mitch
|
166.15 | Might as well try it | TLE::RMEYERS | Randy Meyers | Wed Nov 12 1986 18:50 | 3 |
| It is worth trying "ASSIGN LPT1: PTR:" BEFORE starting Basic. Of course,
the folks at Microsoft might ignore device assignments for their cutsy
"transportable" device names.
|
166.16 | You give up to easily | TLE::RMEYERS | Randy Meyers | Wed Nov 12 1986 18:58 | 6 |
| You folks have a bad attitude. The spirit of hacking is being able make
your machine jump through hoops.
You should try all possible combinations and report back here.
Very :-).
|
166.17 | Scribble! should work. | ANT::SMCAFEE | Steve McAfee | Sun Nov 16 1986 21:11 | 31 |
|
Mitch,
Sorry I took so long to try this in Scribble! Anyhow this is how
I got the sequence stuff to work...
(unfortunately my printer doesn't have shadow mode, so I just did
it with underline)
At top of file:
.#0/0=%27[4m
.#1/0=%27[24m
(The 0 after the / tells scribble that you are not defining a
printable character, so don't set aside any space for it during
justification/wrap.)
Now when I place a "CTRL-G" 0 in my file it turns on Underline.
When I place a "CTRL-G 1" in my file it turns off underline.
For shadow mode use %27[6"z and %27[5"z. If thids doesn't work
then the printer driver you are using probably doesn't support the
sequence.
Good Luck,
Steve McAfee
|
166.18 | It works - 1 more question | APOLLO::BERKSON | | Tue Nov 18 1986 08:47 | 12 |
| Thanks Steve. I successfully used the ALT-G commands to turn on
the shadow printing and some other stuff. I thought I tried that
before, but I guess not. This has opened new vistas to me and has
led to another question specific to the 3131 printer.
I turned on proportional spacing and full justification using the
Scribble ALT-G commands to get the printer to do those things. They
almost work. Proportional spacing is on but some lines are not aligned
on the right margin. They miss by about 2 characters. Any help on
this? Thanks.
mitch
|