Saturday, December 8, 2012

Delphi is my favorite tool for Windows Programming

I've always been drawn to Pascal and preferred it's syntax to the terseness of C.  I learned the basics of Turbo Pascal in an afternoon (after experience with Turing, BASIC and FORTRAN).  For Windows programming, I've always found Delphi to be the best tool available - especially if you aren't a C++ expert.  Delphi combines the power of C++ with the ease of Visual Basic.  I only stopped using Delphi for grade 12 computer science because Delphi 5 (1999) wouldn't run on Vista or Windows 7 and I switched to Java because it was free.  Delphi would have cost the school $100/license.  I never really got into Java (it's a huge language) and now I'll be switching to Python which has a syntax that I prefer.  Some of the programs I use a lot are written in Delphi:  WinGrab and Integrade Pro.

Before the social media craze, I thought RSS feeds would be a great way to publicise school events.  I wrote a Delphi 7 program to update RSS feeds 5 years ago.  It took me about 45 minutes to figure out how to call the Windows API to do FTP tasks with Delphi.  Unfortunately, this never caught on with the school.

However, when I setup Xibo digital signage at school last year, it required an RSS feed as the source of the announcements.  Consequently, I modified the program to suit the needs of this new task.


Recently, I learned how to add images to RSS feeds.  I've been doing this manually and had to figure out how to scale the images properly to maintain the proper aspect ratio.  Today, I figured out how to add this feature to my Delphi program.  I also tried to clean it up a bit so it could be more easily adapted for use at other schools.  I was amazed that you could import an ActiveX control which lets you access the image properties from the browser.  Once I had the height and width of the image, it was easy to scale the image for the RSS feed.  One page I Googled had a typo, but I figured it out by looking at the Delphi generated Pascal file (650,000 lines of code!) for the ActiveX control.  A different page didn't have the typo (I found this 2nd).

I'm glad Delphi is still around.  It's kind of expensive, but educators can have a copy for $100 (RAD Studio Pro even comes with RAD PHP, and C++). Here's a nice site called Delphi for Fun.  I think it's fun too!  It allows a non-expert like me to solve practical programming problems with relative ease!  Delphi Basics is a great reference as one is working with Delphi.

No comments:

Post a Comment