[futurebasic] Re: Print Question

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : September 1998 : Group Archive : Group : All Groups

From: Rick Brown <rbrown@...>
Date: Sun, 27 Sep 1998 08:09:45 -0500
Mikonic wrote:
> Note that counterintuitively (to me anyhow) ROUTE _toScreen comes before a
> CLEAR LPRINT or CLOSE LPRINT.

In my experience, this is not necessary.  I find that this works just as
well:

    LONG IF PRCANCEL = 0

        ROUTE _toPrinter            'route drawing to Chooser printer
        FN PrintFirstPage
        CLEAR LPRINT                'eject first page

        FN PrintNthPage
        CLEAR LPRINT                'eject nth page

        FN PrintLastPage
        CLOSE LPRINT                'done printing, eject last page;
        ROUTE _toScreen

i.e., only one ROUTE _toPrinter and one ROUTE _toScreen are necessary
for the entire job, and the ROUTE _toScreen can come after the CLOSE
LPRINT.  I think it would only be necessary to ROUTE _toScreen during
the print job if, for example, you also wanted to send output to a
screen window at the same time a print job is progressing.  Inter-page
rerouting may also be necessary if you need to monitor button clicks &
such while the print job is progressing.

Putting CLOSE LPRINT before ROUTE _toScreen, as I've done, may have a
drawback--If you do a CLOSE LPRINT, but then the system needs to do
something with the "current port" before you do the ROUTE _toScreen,
then it may get confused about where exactly the "current port" is.  I
don't think this should be a problem as long as the two statements
appear right next to each other, as in my example.

I must say that I was surprised to find that the Print Manager really
does handle "page range" and "number of copies" correctly.  I remember
older Mac systems in which this wasn't the case--the programmer had to
read the Print Record (PRHANDLE), extract the relevant information, and
handle the page range & copy count programatically.

- Rick