[comp.lang.pascal] Dump the graphics screen in TP

cncst@unix.cis.pitt.edu (Christophe N. Christoff) (08/30/90)

I try to dump graphics screen within a TP program.  The problem
is this:

1.  If I assign a file name, then dump the screen to the file
    At DOS, I type:
    COPY /B filename PRN
    the screen dumping is perfect.

2.  If I assign the file name to 'PRN', the dumping in some
     cases is perfect, but in most cases, the dumping would be
     mess up by missing one or two bytes.

3.  If I use DOS interrupt to send the above dumping directly to
    printers, the dumping is also perfect.

What is the difference between assigning a file name and assigning
a device name in TP, how can I avoid the problem in (2)?  Since it
is really handy to assign 'PRN' as a file name.

mead@uxh.cso.uiuc.edu (08/30/90)

Funny you should mention it.  I was just reading in _Turbo Pascal
Advanced Techniques_ (by Chris Ohlsen and Gary Stoker) p183:

    "   The primary purpose of listing 6.4 is to replace the standard
    Printer unit that is supplied with Turbo Pascal V5.5 because Turbo
    Pascal opens its printer unit and LST device in a cooked mode.
    Cooked mode indicates to DOS that it is a text device; any text
    device cannot recieve a EOF marker, therefore it is stripped from
    the output steam.   The driver in listing 6.4 chooses a mode tha
    will pass any character to the printer.  An EOF marker, or ASCII
    character 26, is essential to sending graphics output to the
    printer"

I imagine that this is a problem for you -- although from your
description ("missing one or two bytes"), I'm not convinced that this
is THE problem.

I'd like to reproduce listing 6.4 for you, but it's quite long
(actually, the code is brief, but there are lots of comments).  Also,
they describe hardcopying graphical output in some depth in a couple of
places in their book, so you should obtain a copy.  I got this one from
the library.  I think I'd buy it ($23) if I had a job.

hope this helps,

-alan mead