Delphi

The amazing Delphi development environment, programming tool, and Pascal-based languaged; originally from Borland, now published by Embarcadero

Web Service Timeouts

While working on a project accessing a slow web service, I found myself needing to extend the timeout of the HTTPRIO component. The web service, when executed straight from a browser, would happily take as long as it needed to before successfully completing. But my Delphi application was timing out.

AttachmentSize
CurrentTimeClientExe.zip889.8 KB
CurrentTimeClientSrc.zip6.2 KB
BigDataClientExe.zip448.69 KB
BigDataClientSrc.zip6.85 KB

Mega Update - Part 2

In the last entry, I gave an overview of the large software update I delivered to a client, an update that should've been done incrementally over a period of several months. From database schema changes, to swapping out a reporting engine, to switching from ANSI to Unicode, I really bit off more than I could chew at once. But it's now working well and I'm once again sleeping at night!

This portion of the story deals with the database changes that were made, both the structure and the character set.

Mega Update - Part 1

I recently gave a client a major update to their custom application. Actually, "major" doesn't even do it justice. It was more like "mega major" and I don't think I'll take the approach I did ever again. But I wanted to move their code to the latest compilers and to support the latest operating systems. I also needed to change some low-level database constructs. Why all this? Because I'm a best-practices sort of guy.

ANSI to Unicode Converter

The attached program converts a folder of text files in Windows ANSI format (code page 1252) to the most common Windows Unicode format, UTF-16 using little endian byte order. It allows you to specify the source and destination folders (UNC paths are supported), whether or not to overwrite existing files in the destination folder if they exist, and to even strip off the optional leading Byte Order Mark file header.

It is written in Delphi 2009.

Freeware by Cornelius Concepts.

AttachmentSize
AnsiToUnicodeExe.zip498.62 KB
AnsiToUnicodeSrc.zip230.33 KB
AnsiToUnicodeScreenShot.png63.49 KB

Delphi Version Conditional Defines

There's a really good list of all the conditional defines that have been defined in Delphi (and even Turbo Pascal) over the years at Delphi Wiki. But if you want to see how to use them in code or add a few more for your self to test, here's some code to get you started.

This simple project compiles in all the recent versions of Delphi. If you want to compile it in earlier versions, you'll have to remove a line in the main project file--but you'll quickly realize that when you go to compile.

FREEWARE from Cornelius Concepts.

AttachmentSize
DelphiVersionsSrc.zip1.64 KB

Zip and Unzip files in Delphi without using a 3rd party component

This article shows how to call a Windows API from Delphi to zip or unzip files--without using a third-party component.

Delphi Prism Multi-Platform Videos

This link takes you to the Embarcadero web site containing a bunch of videos by Brian Long about Delphi Prism, the .NET Pascal compiler plug-in for Visual Studio. But it goes beyond just telling you about the language, he shows how to do .NET programming for Linux and Mac!

Widths and Themes

In the old DOS days, things were simple. You had 25 rows and 80 columns of text. Period. Well, if you knew the right tricks, you could double the rows or columns, but still it was pretty limited. This made programming fairly easy--you knew how much space you had to deal with.
With a GUI, or Graphical User Interface, things can get stretched out, you can have larger fonts, and you can have themes on or off. So knowing how much space you have to display stuff isn't quite as cut and dried. But I'm going to look at just one aspect that can be surprising: themes.

History of Delphi Strings

An excellent article on various string types in Delphi.

DateTimePicker Vista Theme!

Adding theme support to your application can give your program a whole new look (if you use standard Windows controls) without changing anything else. This works because the controls will actually use a different set of DLLs behind the scene. In Delphi 2007, this is accomplished with a simple checkbox in the project options. (Visit the Delphi Wikia page and search for "Adding Theme Support" for more information.) The DateTimePicker is one of these and I just discovered its new capabilities when themed on Vista or Windows 7.

Delphi Hints vs. Warnings

Consider the following psuedocode fragment:


for each FieldValue in RecordList do begin
  if ValidSearchValue(FieldValue) then
    found := Search(FieldValue)
  else begin
    ShowMessage('Invalid search criteria: ' + FieldValue);
    Continue;
  end;
end;
 
if found then
  ...

In Delphi, a warning will be generated near the bottom of this code where it says "if found ..." saying:

Variable 'found' might not have been initialized

To prevent that warning, you would initialize "found" just inside the "for each" loop with something like found := False;

But then, Delphi emits the following hint:

Value assigned to 'found' never used

Delphi Area

Another great resource for Delphi Developers.

Using BING from Delphi

It didn't take long for Delphi users to not only figure this out, but to publish an article for it!

Components for Delphi 2009

Here's a collection of Delphi components, including several from the Turbo Power library, that have been upgraded to work under Delphi 2009.

The Case for Native Code

Developing GUI-rich applications in native code usually limits the choice of operating systems. Java has tried to answer that with one approach, .NET with another, REAL Basic with yet another.

Delphi Almancs

The Delphi Guru at About.com has posted over 10 years worth of tips, tricks, tutorials, and articles covering a huge variety of Delphi topics. Check it out!

Arbitrarily Large Integers

Need to deal with gigantic numeric values in Delphi?

BlackfishSQL Introduction

A great introduction to actually creating and using a BlackfishSQL database in both a Win32 application and a .NET application, both using Delphi 2007.

Starting with Delphi Prism

I've recently acquired the latest Pascal language compiler from RemObjects, Oxygene. Embarcadero, now the owners of Delphi, decided not to continue development of Delphi for .NET, but instead license this compiler plug-in for Visual Studio from RemObjects. So if you get RAD Studio 2009 from Embarcedero, which includes Delphi 2009 for Win32, you also get a special single-language version of Microsoft Visual Studio with the Pascal compiler from RemObjects. If you buy this from Embarcadero, it's called Delphi Prism. If you buy it from RemObjects, it's called Oxygene.

Delphi History

Delphi is one of the greatest development environments every produced for Windows. It has an easy to learn, yet strict language that leads to less confusion than C++ and better coding practices than Visual BASIC. Unfortuneately, it has been marketed by a company that has made so many changes in direction and name that people have laughed it off. One more change has happened recently, here is the story, which actually starts over 25 years ago, before Windows.

Syndicate content