Education is an admirable thing, but it is well to remember from time to time that nothing that is worth
knowing can be taught. (Oscar Wilde)

Some irrelevant musings about Delphi programming and my life.


Subscribe in a reader

February 04, 2007

Hello World

Before even thinking about starting a Blog, I wanted to make sure I could easily post code snippets, without endlessly hassling with html markup. A mere copy and paste won't preserve formatting, so I needed a simple tool to convert source code to html, preferably giving me the possibility of doing some syntax highlighting.

The BDS 2006 community welcome page v2 (provided by Daniel Wischnewski) has a handy utility, using a CDN web service provided by John Kaster, called YAPP - Yet another pretty printer. This service allows you to format source code to HTML, directly from within the Delphi IDE. It tags reserved words, comments, quotes etc. with classnames, so you can use a stylesheet to do syntax highlighting. Exactly what I needed. Thanks guys!

To illustrate the point, here is the classic and unavoidable "Hello World" example (in Delphi):

uses
  Dialogs;

procedure HelloWorld;
begin
  // superfluous comment
  ShowMessage('Hello World');
end;

It seems I've overcome my first Blogging hurdle. Ready to go on to even greater and more meaningful things. I'll keep you posted.

O, and if you're wondering where to put your syntax highlighting styles: log in to blogger, and navigate to menu option "customize", tabsheet "template", menu option "edit html". Have fun!

No comments:

Interesting Links