Print Xojo source code in colour

This may be a very good exercice to do.

I found a location of the “REALbasic XML Project Format” document: here .

I simply copy / paste the html contents into a text editor, save it as html file and load it into my browser.

A paid market ? No. A free demand ? Maybe.

Who do not want to have a report on its application code source ?

When (back in 1993 in think) I publish my 1st Addin to Visual Basic to print the source code in colour with line numbers, page headers etc, majority of my friends in colleagues told me not to waste time. They said none will buy it. I carried on developing it as I enjoyed it. Since then I developed adding to VBA and Visual Studio .NET and also print SQL Server Schema. I must say, the proceeds from the sales got my three kids though University in the UK and more. The sales are still going strong. Users seem to be happy to pay $59(US) for each copy. May be Xojo users are different. In my programming experience of past 40 years has taught me that some programmers will never print, some will print but never pay for it, BUT a small percent will pay. A small percent of large number of programmers around the world is pretty good number.

A lot of companies use the source code printed with line numbers for code inspections. A lot of freelance programmers tell me that they get repeat business only because when they finished any project they printed it and bound it and handed it to the clients.

I will continue for the time being and see how it goes.

Regards,
Joginder Nahil
www.starprinttoos.com

FYI… you might want to fix you signature…

StarPrintTools

you forgot the “L”

None of your example pages show how your tool handles the GUI part of an application

Printed source was useful 25 years ago. The problem is that it usually goes out of date before the ink dries.

“Printed” as on paper… I agree.
“Printed” as in electronic documentation… required in a lot of cases.

“printed” as in “not the original source” is usually out of date

well written source code with comments is, in my experience, much more reliable & informative than any printed documentation (electronic or otherwise)

a. I may not say so, but I was talking “print to pdf”; the last (large in # of paper pages) printings was done when REALbasic was in version 2 or so (after printing Language Reference of version 1.

It was very usefull (I was able to correct errors in the documentation, place infos, tips, etc. on the facing page (non printed page).

Talking about that, I was thinking like a fool yesterday afternoon: what about the ability to add a “User Comment field” in the Local documentation (for user purposes like reminder, tip, etc.) ?

I am assuming that Xojo is used for developing real world applications. In my experience such applications should have code reviews. Here is an email from one of customers sent to me few weeks ago:

“We have a process for code reviews, in which we basically want each and every code item should be passed through code reviews. We have thousands of code files in our solution which contains many projects. Every code file is first reviewed by the developer itself and then passed on to senior developer for review. Most of the code files are already gone through developer code review. Now I want to generate PDF files for all such code files so that those can be attached to a code review process tracking tool through which senior developers can simply grab and do the reviews, mark their comments etc…”

Here is another one that I received yesterday:
"Your program is fantastic. I have been looking for something like this for years. I use it to store code that might get lost in a crash. I constantly tweak my macros and it is wonderful to print off a PDF rolling status as backup. It also helps greatly when making code efficiencies because codePrint can sit as an open window alongside the VB window. Thanks
"

One could say that the above user should be using source control repository but it is up to them.

I do agree with most of the points raised, however, there must be programmers who want to print the source for support purposes, understand someone else’s code.

What about university/College students who want to submit paper copy or electronic copy (PDF). Here is en email from one student in Brazil who asked for a free copy of my app to print the source code:

"Thank you very much Mr. Nahil.
I really appreciate your decision.
I am Chemical Eng and Computer Scientist and my master program working mix this 2 areas = chemometrics!
I finished to print my source code for send to legal representatives (copyright) using your VSCodePrint. excellent tool!!!
I will recommend it ever!
Thanks again!"

University of San Diego tells me that they only accept student projects with source code printed using my add-in.

I hope the above applies to Xojo source code.

Regards,
Joginder Nahil
www.starprinttools.com

For anyone interested… I will be posting a XOJO Source Code Printer in a few days…

At this point I have it printing the source code, with line numbers and partial syntax coloring…

So it is mostly getting the output “prettied” up.

Once complete (OSX first, then Windows) I will post it for anyone who wants to use it. Donations will be accepted :smiley:

Whats wrong with the built in printing ?
Line numbers ?

It better as it uses the same code base to do it
Same indenter, same colorizer etc (it just doesn’t print the background)

Not having an easy way to “Print entire project” is a pain
Not sure if there’s a bug report for that or not

But you can select any item & print just that, print the image of a layout etc

Personally… I hate the format…
*Properties seem to be printed willy-nilly, before methods, between methods
*can’t easily print entire project
*No LineNumbers
*No table of contents
*No index
*No analysis of the project
*It color syntaxs NOTES (an error in my opinion)
*doesn’t connect control blocks

and thats off the top of my head : [hey… you asked]

Really ?
I get things in a nice order
Constants methods enumerations properties etc
Computed properties vs plain properties there’s a difference since computed properties show up more like methods with a bold header

Right :stuck_out_tongue:

[quote=66669:@Norman Palardy]Not having an easy way to “Print entire project” is a pain
Not sure if there’s a bug report for that or not[/quote]
There’s a NOT OBVIOUS way - select NOTHING in the navigator and hit print

Per method you mean ?
Thats the only way things make any sense since “line 600 of project X really has no meaning”
This one would be quite trivial to add

Yeah to generate a TOC you have to do it last then insert it
Cant do it first since - well printing the IDE project its 10,000+ pages
An index would be easier since it usually fits at the end of a document

Metrics you mean ?
Lines of code etc ?
This one is … well if you use a lot of #if then you may be counting “lines” but not “executable lines” and you start needing to be the compiler to get it right

This one isn’t should not be hard to change

OOhhhhh this one is my personal favorite since I literally spent christmas revamping this in the IDE
Have fun with it
Stuff like this (which is perfectly legal) and then you can wrap cases in a select in #if etc

#IF true
  if not true then
#endif

do something

#IF true
      end if
#endif

It gets to the point either you need the compiler to help you to know what code paths ARe going to be compiled at this point in time OR you simply surrender that there are things that “pretty printing” cannot get right

I wish you all the best though

From what I can find there are 2 bug reports / feature requests about printing projects

Dave and/or Joginder,

Printing an image of the layout along with the code listing would be a great feature. Even better would be a listing of all the controls right after the layout image.

I now see that this works for Desktop projects, but alas not for Web projects.

Already planned… first version will just be “code”… then I will start adding features

Web projects don’t have a real “control” you can just draw into like a desktop project - hence the difference
They’re basically all custom drawn

[quote=66669:@Norman Palardy]Whats wrong with the built in printing ?
Not having an easy way to “Print entire project” is a pain[/quote]

Wrong ? It add a space at line end and issue a LF, then print the remainding of the line. It does not care if the space comes inside a word.

Also, when Copy / Paste (Preview 10.8.5 and prior), it often forgot a LF and so two or more lines (PDF) appears in one (TextEdit).

Print the entire project:
Not checked what was printed carefully, nut I can print the whole project (to PDF) without trouble (only select the entries in the Navigator, then cmd-p). So, not intuitive at first, but I found how to do that faster than many, many other things.

Q: Is the MenuEditor contents printed / Printable ?
Maybe nothing is print if the MenuBar is the standard one (nothing added to it) ?

Not obvious ? Yes, you are right, but we may find it by pure hazard and not notice it thus some rants from the user (I got it one and I cannot get it anymore) especially if (s)he prints at project load time.

I would never have tried deselect all inputs to test in a conscious way (but perhaps after tons of unfruitful tests).