Loading ...
Sorry, an error occurred while loading the content.
 

Re: LPRINT....

Expand Messages
  • sharpdj5927
    Interesting to see how lprint can be used. The code below works fine. But it works the same on my usb laser printer without the DUMP command. I cannot get
    Message 1 of 12 , Sep 1, 2010
      Interesting to see how lprint can be used. The code below works fine. But it works the same on my usb laser printer without the DUMP command. I cannot get the printer to sit for more than a few seconds before it prints all the lprints it has received as in the program below. So how big is a printer buffer normally? and/or is there a timer in windows that flushes the buffer anyway? I cannot see anything in printer preferences that controls this.

      Best regards
      Derek Sharp



      --- In libertybasic@yahoogroups.com, "green8819" <green8819@...> wrote:
      >
      >
      >
      > Thanks to Derek, Stefan and Marc for the comments on PRINT/LPRINT.
      >
      > --- In libertybasic@yahoogroups.com, "sabaumarc" <marcsabau@> wrote:
      > >
      > >
      > >
      > > --- In libertybasic@yahoogroups.com, "Stefan Pendl" <pendl2megabit@> wrote:
      > > >
      > > > > >
      > > > > > I do not see any LPRINT in the code. Yet my printer is
      > > > > asking whether to print the output to hard copy. How is that?
      > > > > >
      > > >
      > > > The graphics method PRINT is used to send the last flushed segment to a printer from a graphics box or window.
      > > >
      > > > LPRINT on the other hand only sends text to a printer.
      > > >
      > > > >
      > > > > I only have laser printers and lprint is not much good . Its
      > > > > fine for a dot matrix line printer that will print one line
      > > > > and sit there happily and wait for the next lprint to come
      > > > > along after the program has done some more processing. The
      > > > > paper can't sit on the laser drum it has to pass or burn! I
      > > > > haven't got an inkjet printer. An inkjet printer perhaps
      > > > > works with lprint ok as the paper can just sit and wait I
      > > > > imagine. Can anyone with an inkjet printer confirm this please?
      > > > >
      > > >
      > > > LPRINT sends the text to print to a buffer and the contents of the buffer will be send to the printer with DUMP.
      > > >
      > > > If you use DUMP after each LPRINT, you will end up with one line per page.
      > > >
      > > > Usually you collect all the data needed to create a printed page, send that to the buffer with LPRINT and start printing the page
      > > > with DUMP.
      > > >
      > > > ---
      > > > Stefan Pendl
      > >
      > > See below a LPRINT example using "DUMP" with inkjet printer :
      > > PrinterFont$="courier_new 10 Bold"
      > > for S=1 to 79
      > > LT$=LT$+"-"
      > > next S
      > > LPRINT "DEPENSES DE ";nomasso$;DJT$
      > > TLP$= "------------"
      > > LPRINT TLP$
      > > LPRINT "DATE";tab(12);"NATURE";tab(62);"MONTANT"
      > > LPRINT LT$
      > > LPRINT
      > > for I=1 to DEP
      > > LPRINT depdate$(I);tab(12);depnat$(I);tab(62);depval$(I)
      > > next I
      > > LPRINT
      > > LPRINT tab(12);"TOTAL DEPENSES = ";tab(62);TOTALDEP$+" Euros"
      > > LPRINT tab(12);"--------------";tab(62);"--------------"
      > > DUMP
      > >
      > > Marc SABAU.
      > >
      >
    • Stefan Pendl
      ... LB has been developed with Win9x/ME compatibility, so there has surly something changed during the past few years. The printing functionality has not been
      Message 2 of 12 , Sep 1, 2010
        >
        > Interesting to see how lprint can be used. The code below
        > works fine. But it works the same on my usb laser printer
        > without the DUMP command. I cannot get the printer to sit
        > for more than a few seconds before it prints all the lprints
        > it has received as in the program below. So how big is a
        > printer buffer normally? and/or is there a timer in windows
        > that flushes the buffer anyway? I cannot see anything in
        > printer preferences that controls this.
        >

        LB has been developed with Win9x/ME compatibility, so there has surly something changed during the past few years.

        The printing functionality has not been touched for a long time from looking at the release notes, I think.

        From the help file topic about LPRINT:

        <quote>
        Liberty BASIC will eventually send your print job, but DUMP forces the job to finish.
        </quote>

        So it seems that due to your configuration (computer + printer + driver) LB sends the job before the DUMP.

        You may try to first output the page to a temporary file and then send the contents of the file as one whole string to the printer
        using LPRINT + DUMP.

        ---
        Stefan Pendl
        http://stefanpendl.runbasichosting.com/

        Liberty BASIC 4.04 Pro ... http://www.libertybasic.com/assist.html
        Liberty BASIC 4.04 ....... http://www.libertybasic.com/lb404setup.exe

        Books at http://www.lulu.com/ and http://www.amazon.com/
        Alyce Watson ... APIs for Liberty BASIC
        Carl Gundel .... Beginning Programming with Liberty BASIC

        Windows 7 Home Premium 64-bit RTM
        AMD Turion X2 RM-70 2GHz, 4GB RAM
      • Jim Hiley
        Consider the problems of a shared printer. If an application takes too long between pages, another application will send its print job and the pages will be
        Message 3 of 12 , Sep 1, 2010
          Consider the problems of a shared printer.
          If an application takes too long between pages, another application will
          send its print job and the pages will be all jumbled up in the printer.
          Not a big problem for a single user, but hell in network situation.

          Windows does have settings for printer timeout.
          Where the settings are depends on the version of windows.
          They started out in system.ini and are now in the registry.
          Network printers usually have their own settings, one to stop another print
          job starting too soon and another to timeout a slow/stalled print job.
          I would leave the setting alone....

          The printer buffer can be anywhere from a few kB to a large hard disk.
          Windows also has spoolers for each printer.

          Stefan's suggestion of using a temp file to prepare the whole print job
          before sending it is a good choice. It solves a lot of problems.

          Jim Hiley

          -----Original Message-----
          From: libertybasic@yahoogroups.com [mailto:libertybasic@yahoogroups.com] On
          Behalf Of Stefan Pendl
          Sent: Wednesday, 1 September 2010 19:24
          To: libertybasic@yahoogroups.com
          Subject: RE: [libertybasic] LPRINT....

          >
          > Interesting to see how lprint can be used. The code below
          > works fine. But it works the same on my usb laser printer
          > without the DUMP command. I cannot get the printer to sit
          > for more than a few seconds before it prints all the lprints
          > it has received as in the program below. So how big is a
          > printer buffer normally? and/or is there a timer in windows
          > that flushes the buffer anyway? I cannot see anything in
          > printer preferences that controls this.
          >

          LB has been developed with Win9x/ME compatibility, so there has surly
          something changed during the past few years.

          The printing functionality has not been touched for a long time from looking
          at the release notes, I think.

          From the help file topic about LPRINT:

          <quote>
          Liberty BASIC will eventually send your print job, but DUMP forces the job
          to finish.
          </quote>

          So it seems that due to your configuration (computer + printer + driver) LB
          sends the job before the DUMP.

          You may try to first output the page to a temporary file and then send the
          contents of the file as one whole string to the printer
          using LPRINT + DUMP.

          ---
          Stefan Pendl
        Your message has been successfully submitted and would be delivered to recipients shortly.