3
votes

How to print formatted Delphi source on a printer?

3
Hmmm, how about: open source file in IDE, format it (manually or using Ctrl-D in D2010+), print it (File|Print)?Marjan Venema
Well, this is embarrassing. Thanks. I was looking for it in Edit menu and Ctrl+P does not work from IDE. Thanks again.user645976
You mean print, like in transfer usable, navigable code from the IDE onto "dead trees"???? Why? This is not necessary the "I'm green so I don't print" talk, I'm simply curious, why would you want to PRINT code? I find printed code awful, a pain to read;Cosmin Prund
@Cosmin, I've occasionally found it useful in a code review, either to allow viewing several pages at once, or to allow marking it up with a pen. It can also be helpful it you're giving a presentation and want to provide hand-outs for people to refer to while you talk.Rob Kennedy
@Marjan: you should make this an answer so it can be accepted.Uwe Raabe

3 Answers

4
votes

As suggested, here is my comment as an answer:

To print formatted source code from the Delphi IDE:

  • Open the source file in IDE,
  • format it (manually or using Ctrl-D in D2010+),
  • print it (File|Print)
0
votes

Once, when I had to take over a legacy red-headed stepchild project that had always gotten the left over efforts of programmers ordered to work on it, I did a lot of analysis of the code flow and logic using Microsoft Word. I copied the code out of the environment (it was in VB, but the same thing would work in Delphi), pasted it into Word in a mono-spaced type and added comments using text boxes, etc. In the comments, I could condense some obscure sequences into pseudo-code or summarize the requirements and effects of code blocks or do anything else that made the code more understandable to me. There were a few times when I needed to discuss the code with others and at that point I could email or sometimes even print my attempts at making sense from some pretty unruly code.

Although this is a reason why I might print some code, I would probably not do it directly from the IDE.

0
votes

If you want to do this from your own software, you can use SynEdit.

It highlights code in a TMemo-like component, and you can print that. It's free and doesn't require external dll's or anything.

http://sourceforge.net/projects/synedit/