Author Topic: Really got to implement source code printing  (Read 5142 times)

0 Members and 1 Guest are viewing this topic.

Offline doppler

  • Forum Regular
  • Posts: 241
    • View Profile
Really got to implement source code printing
« on: October 03, 2018, 07:23:57 am »
It's the one nice thing about the old QB45 program I liked.  Source code printing.

Now I have to use Programmers Notepad ( http://www.pnotepad.org/ ) to view then
print my code.  Because PN, see's the code as visual basic (close enough) it creates
color separated printing output.  AKA, makes it easier to read.

It may not be easy to include in the IDE printing.  But maybe it's possible to "cmd"
out to some printing program or send the code to PN to be printed.

Offline RNBW

  • Newbie
  • Posts: 20
    • View Profile
Re: Really got to implement source code printing
« Reply #1 on: October 03, 2018, 11:03:33 am »
It's the one nice thing about the old QB45 program I liked.  Source code printing.

Now I have to use Programmers Notepad ( http://www.pnotepad.org/ ) to view then
print my code.  Because PN, see's the code as visual basic (close enough) it creates
color separated printing output.  AKA, makes it easier to read.

It may not be easy to include in the IDE printing.  But maybe it's possible to "cmd"
out to some printing program or send the code to PN to be printed.

Dav's IDE allows you to print out your code.  Unfortunately, it only seems to do it in black text. 

Dav, maybe this is another thing to look at when updating your IDE.

Offline TerryRitchie

  • Seasoned Forum Regular
  • Posts: 495
  • Semper Fidelis
    • View Profile
Re: Really got to implement source code printing
« Reply #2 on: October 03, 2018, 11:37:27 am »
Printing out source code, in color, can be very expensive on today's printers. Imagine printing out my yet finished sprite library that crossed the 3000 line threshold recently. However, I agree printing out a subroutine here and there in color would be nice.

What I personally would want is a way to dump raw text to a dot matrix printer, you know, the kind that uses continuous form feed paper. I keep an old Pentium 200MMX operating DOS 6.22 connected to an IBM 2380 for when I need to print out an entire large listing. No color, but very economical to print since I can condense the printout and get many more than the standard 66 lines per page.

I tried connecting the printer over the years to various versions of Windows but the drivers either force the printer into a graphics mode (which takes f o r e v e r to print) or some of the ASCII codes sent to the printer get confused and it starts to print garbage.

I know support for dot matrix printout is a pipe dream, but I think it's still the best option for very large source code.
In order to understand recursion, one must first understand recursion.

Offline doppler

  • Forum Regular
  • Posts: 241
    • View Profile
Re: Really got to implement source code printing
« Reply #3 on: October 03, 2018, 02:33:07 pm »
I know support for dot matrix printout is a pipe dream,

Not a pipe dream, you can specify a text printer as a printer.  There are drivers for it.

Of course the axiom, garbage in garbage out is all too true.  Graphics won't go right.

So drag out the tractor feed printer and load it with micro-tear down perf paper.
 

Offline TerryRitchie

  • Seasoned Forum Regular
  • Posts: 495
  • Semper Fidelis
    • View Profile
Re: Really got to implement source code printing
« Reply #4 on: October 03, 2018, 07:52:20 pm »
Yes, I've tried a few of those, one that comes to mind was PRNDIR (a console PRN redirector). However, since they operate through Windows they always threw the printer into a graphics mode, which would eventually print out the listing, but I'm talking minutes per page here, sometimes as long as 10 minutes per page.

Remember the DOS days?

TYPE listing.bas > prn

Wham, bam! 320 characters per second here I come! That's about 12 - 15 pages per minute.

That's why I keep the old DOS machine around, to send listings out to the printer using the method above.
« Last Edit: October 03, 2018, 07:54:20 pm by TerryRitchie »
In order to understand recursion, one must first understand recursion.

Offline codeguy

  • Forum Regular
  • Posts: 174
    • View Profile
Re: Really got to implement source code printing
« Reply #5 on: October 03, 2018, 09:09:58 pm »
Wouldn't it be ok to display formatted text to a software image and then print the contents of that image to a printer? THAT would maybe be ok, or simple printer codes to boldface QB64 keywords on a listing for printing on a dot matrix printer (like seen with QuickBasic 1.0 for Mac)? I agree, DMP listings are probably much simpler since it's only sending escape sequences, along with text. I used to print double columns too in landscape mode using a custom program I wrote.

Oh yeah, DON'T stick your tongue on the DMP printhead.
:)
« Last Edit: October 03, 2018, 09:13:27 pm by codeguy »

Offline TerryRitchie

  • Seasoned Forum Regular
  • Posts: 495
  • Semper Fidelis
    • View Profile
Re: Really got to implement source code printing
« Reply #6 on: October 03, 2018, 10:30:24 pm »
I still have a bunch of those escape sequence code books for various DMP printers laying around here from the 80's and 90's. Life was so much simpler back then. :)

Quote
Oh yeah, DON'T stick your tongue on the DMP printhead.

Remember the first time I burnt my finger ... it was an Epson MX-80 ... lazy afternoon of coding in 1981 ... new printer ... ooh, that's shiny!   Ouch!
« Last Edit: October 03, 2018, 10:32:42 pm by TerryRitchie »
In order to understand recursion, one must first understand recursion.

Offline codeguy

  • Forum Regular
  • Posts: 174
    • View Profile
Re: Really got to implement source code printing
« Reply #7 on: October 03, 2018, 10:51:22 pm »
For example, a source listing of 226 lines could be printed in 2-column format in portrait (80 characters wide) in 2 pages, 66 lines/page, 4 total columns and 28 lines on 2nd column of 2nd page.. It will be more if truncating lines is not an option. I am working on it.
« Last Edit: October 03, 2018, 11:13:17 pm by codeguy »

Offline codeguy

  • Forum Regular
  • Posts: 174
    • View Profile
Re: Really got to implement source code printing
« Reply #8 on: October 03, 2018, 11:04:43 pm »
Multi-column, portrait print of source with truncation. Will be completing parsing to eliminate truncation. But you get the idea. THIS would be a handy utility for everyone. cgXColumnSourcePrint() :). This would be like the multiple columns of QuarkXPress, one of my Mac SE favorites. I had an excellent source of software from my neighbor who worked for Chicago Tribune. Otherwise, it was big $$$ for such cool software. I am designing this to print multiple columns past 2 also.
« Last Edit: October 04, 2018, 12:11:22 am by codeguy »

Offline qbguy

  • Newbie
  • Posts: 11
    • View Profile
Re: Really got to implement source code printing
« Reply #9 on: October 07, 2018, 03:32:20 am »
For dot matrix printers, just save as LPT1 and it should print your text directly to the printer (assuming the printer is actually connected directly to the parallel port).  The editors Notepad++ and Emacs let you print out a syntax-highlighted version of your source code.  For Emacs this is PostScript format (which can be passed directly to a PostScript laser printer or to CUPS), for Notepad++ this uses the Windows printer driver.

Looks like the EPSON dot matrix printers had bold but only in draft mode, but in NLQ mode there is underline and italics. I remember WordPad (write.exe) could also print using the printer's text fonts on Windows if you select the appropriate font.  LPRINT also worked for text mode even in Win 2000 NTVDM on the Epson EX800.

https://files.support.epson.com/pdf/ex800_/ex800_u1.pdf

We already have LPRINT on Windows in QB64, which seems to print to the default Windows Printer.  Not sure if it's there on Linux and Mac.
« Last Edit: October 07, 2018, 03:36:59 am by qbguy »