Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Lprinting printer control codes?
#14
Hi Guys,

I figured out a (kludgy) workaround. I implemented it in one of my programs and it seems to work (until it doesn't.)

Before I modify all my other programs, I wanted to get your input on possible pitfalls.

At the beginning of the program I open a file, "printer.prn" for Output as file number ff%.

I changed ALL my Lprints to Print #ff%, (something I tried very hard to avoid.)
 
Every time I issue a page feed, Print #ff%, chr$(12), I call this sub:

Sub PrintTheFile
    printfile$ = "printer.prn"
    Close ff%
    Shell _Hide "copy " + printfile$ + " prn"
    Open "O", ff%, printfile$:
End Sub

I probably could have used PRINT instead of COPY. One of the downsides here is that using SHELL copy (or PRINT) sends it out LPT1 so I have to make sure LPT1 is redirected properly.

I found SUBing after each page feed gave me much more control then waiting until the entire job was in the file.

I close the file and reopen it to make sure what I already sent to the printer does not get reprinted.

Any comments would be appreciated.

A
Reply


Messages In This Thread
Lprinting printer control codes? - by arnoldhf - 08-03-2022, 08:03 PM
RE: Lprinting printer control codes? - by Pete - 08-03-2022, 10:53 PM
RE: Lprinting printer control codes? - by Pete - 08-03-2022, 11:52 PM
RE: Lprinting printer control codes? - by Pete - 08-04-2022, 12:06 AM
RE: Lprinting printer control codes? - by Pete - 08-04-2022, 12:39 AM
RE: Lprinting printer control codes? - by Pete - 08-04-2022, 02:34 AM
RE: Lprinting printer control codes? - by arnoldhf - 08-07-2022, 03:08 PM



Users browsing this thread: 5 Guest(s)