🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #7238

Re: TC++ & DeskJet+ graphics programming: can't print '\x1a' !!??

#7238
From: Michael CIAVARELLA
Date: Sat, 22 Jun 1991 01:23
41 lines
2565 bytes
a_rubin@dsg4.dse.beckman.com (Arthur Rubin) writes:

>In <1991Jun21.040657.3195@ux1.cso.uiuc.edu> mdcg7180@uxa.cso.uiuc.edu (Michael David Carr) writes:

[stuff about printing graphics sent to /dev/null ]

>>     It isn't the printer, because I can send a 26 in BASIC and
>>FORTRAN.

>I've noticed this also.  You might try (re)opening the printer in "b"inary mode
>rather than in "t"ext mode.  Sometimes that works.

Yep - opening in binary *should* work.  The problem isn't with Turbo C++ or
with the printer, but is to do with the way in which DOS handles files.
It assumes that the PRN file is a text-device, and, surprise surprise, the
ascii value 26 just corresponds to DOS's EOF (end-of-file) marker.  So,
you send a \0x1a and DOS thinks "Whoopee! end of file - lets ignore everything
after it!.  Voila!  Instant problems.

If that doesn't work, try writing directly to the printer port (the number
WAS here somewhere.....damned paperless office ;-)

Oh, and to the original poster (Mike Carr) and probably most people on the net:
	If you're new to a language/system/whatever and you have a problem
	which you can't figure, then by all means, ASK WHOEVER YOU CAN!
	At least you'll be learning something, and it gives knowledegeable
	people a chance to show off :-)  Besides, the net _IS_ for the 
	worthfile exchange of information.  Just my $0.02 worth.  actually, I
	probably owe someone that, given inflation these days......


Mike


-----------------------------------------------------------------------------
           X
      (D  / \   C)            email : mikec@mullauna.cs.mu.oz.AU
      r>_%   =--{]            snail : PO Box 542, Kyabram, Victoria, 3620.
     /&          z\                              Australia
    ///\        /\\\          voice : +61 3 3421692 
   /   ^        \  \\                 "The way of the katana"       
Technical Details
Message-ID: <mikec.677553814@mullauna>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!think.com!spool.mu.edu!munnari.oz.au!cs.mu.OZ.AU!mullauna!mikec
References: <1991Jun21.040657.3195@ux1.cso.uiuc.edu> <a_rubin.677519221@dn71>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!think.com!spool.mu.edu!munnari.oz.au!cs.mu.OZ.AU!mullauna!mikec
From: mikec@mullauna.cs.mu.OZ.AU (Michael CIAVARELLA)
Newsgroups: comp.os.msdos.programmer,comp.sys.ibm.pc
Subject: Re: TC++ & DeskJet+ graphics programming: can't print '\x1a' !!??
Keywords: deskjet, tc++, c, c++
Message-ID: <mikec.677553814@mullauna>
Date: 22 Jun 91 01:23:34 GMT
Article-I.D.: mullauna.mikec.677553814
References: <1991Jun21.040657.3195@ux1.cso.uiuc.edu> <a_rubin.677519221@dn71>
Sender: news@cs.mu.OZ.AU
Distribution: aus
Organization: Comp Sci, University of Melbourne, Australia
Lines: 41