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

Possibly Related Threads…
Thread Author Replies Views Last Post
  Need a Printer/Tester SMcNeill 14 2,066 06-04-2024, 07:11 PM
Last Post: bplus
  control characters in Change dialog box digitalmouse 10 1,868 05-09-2024, 02:17 AM
Last Post: digitalmouse
  Possible to control Windows 11 volume? loopy750 4 1,106 01-16-2024, 10:52 PM
Last Post: madscijr
  Printing to my Printer Dimster 17 6,981 07-14-2022, 06:54 PM
Last Post: SMcNeill

Forum Jump:


Users browsing this thread: 1 Guest(s)