Differences between Delphi and Lazarus

Some important differences between Delphi and Lazarus that you are likely to encounter before long are as follows.

  • The compiler directive for a Delphi console application is {$APPTYPE CONSOLE}. This is not necessary in Lazarus but its use does not generate an error. The Lazarus directive {$mode objfpc} is not recognised by Delphi.
  • When you save a Lazarus project the Lazarus file with the extension .lpi is an XML file containing project information such as the name of the source file. To open a Lazarus project, open the file with the .lpi extension. (This has the same icon as the .ico file). All the actual code that you write in a simple console program such as our "Hello World" example will be in a file with the extension .lpr.

    The Delphi project file has the extension .dpr in Delphi 7. In Delphi 2007, the .dpr file contains the code and the .dproj file contains project information in XML format.

  • If you close Lazarus then reopen it, the last program will be opened already for you in the editor. Delphi starts up without a program loaded into it.

  • We find that the help provided in Delphi is more comprehensive and easier to use than that in Lazarus. The Delphi 7 help is particularly easy to use.

  • Some students have reported problems with the stability of earlier versions of Lazarus, but we believe that the current version is very stable.

  • The SysUtils unit is sometimes needed in Delphi for some subroutines that are inbuilt into the core of Lazarus.

  • Lazarus but not Delphi contains Crt, Graph, WinCrt and WinMouse units. See how to download and use Crt in Delphi in our Graphics tutorial.

    The WinCrt, WinMouse and WinGraph units, used in several programs on this site, are useful extensions to both Lazarus and Delphi. (See our Graphics tutorial for details of Stefan Berinde`s wingraph.zip). To use them in Lazarus, remember to put Stefan Berinde`s units in the program folder so that Florian Klaempfl's inbuilt WinCrt and WinMouse units are not used instead.

Programming - a skill for life!

Getting Started, Links and other resources