[comp.lang.pascal] TP printer-unit bug ?

st%trillian.irb@unido.uucp (Stefan Timphus) (05/24/89)

I want to send a Escape sequence to my printer (i.e. chr(27),chr(71) for NLQ)
but the only thing I get is that the character after the Escape is printed
(in this case instead of NLQ I only get a "G"). I'm using the unit printer of
Turbo 5.0. Is this a bug in Turbo 5.0 ? I know I had the same program running
under previous Turbo Versions. Or did they invent something new which I haven't
found yet in the manual ? I think it must be a Turbo problem because I tested
it under different DOS-Versions and I get the wanted result using Basic.
                  
                                              Any ideas ?
                                                Stefan

bjornb@rhi.hi.is (Bjorn H Bjornsson) (05/26/89)

First the bad news:
I had the same problem last summer with TP4.
Seems that in the old days (less or equal TP3) TurboPascal used lowlevel
routines to read and write to the ports, but now TP uses higher level
DOS functions to do the same thing.
For some reason (way beyond comprahension) these functions filter out ESCAPE.

And now the good news:
Ernest V. Mathews III sent me a substitude printer-unit which can print
ESCAPE.  I would have posted it here, but I'm not sure whether this newsgroup
is the right spot for such things.  AND because this being a year ago, there
must be a newer version of the program out there (somewhere).  I'll post it 
to you, though, if you want.

Bjorn
-- 
Bjorn Heimir Bjornsson		Internet:  bjornb@rhi.hi.is
University of Iceland		UUCP:	   {mcvax,enea}!hafro!rhi!bjornb

leonard@bucket.UUCP (Leonard Erickson) (05/30/89)

In article <1384@laura.UUCP> st%trillian.irb@unido.UUCP (Stefan Timphus) writes:
<I want to send a Escape sequence to my printer (i.e. chr(27),chr(71) for NLQ)
<but the only thing I get is that the character after the Escape is printed
<(in this case instead of NLQ I only get a "G"). I'm using the unit printer of
<Turbo 5.0. Is this a bug in Turbo 5.0 ? I know I had the same program running
<under previous Turbo Versions. Or did they invent something new which I haven't
<found yet in the manual ? I think it must be a Turbo problem because I tested
<it under different DOS-Versions and I get the wanted result using Basic.

Ever since TP 4.0 the LST "file" is opened in "cooked" mode, rather than
"raw" mode. This means that it is subjected to the same limitations as typing
at the DOS prompt. (^Z is end of file, tabs are expanded, ESC is filtered
out...)

I know there is a way to open the printer as a binary file, not as an "ascii"
file, but I don't remember it offhand. One suggestion would be to open
PRN as a file of byte instead of using the LST "file".

-- 
Leonard Erickson		...!tektronix!reed!percival!bucket!leonard
CIS: [70465,203]
"I'm all in favor of keeping dangerous weapons out of the hands of fools.
Let's start with typewriters." -- Solomon Short