skip to content

Delphi

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.

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.

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!

Syndicate content
Powered by Drupal. CrystalX theme created by Nuvio | Webdesign.