Questions tagged [delphi]

Delphi is a language for rapid development of native Windows, macOS, Linux, iOS, and Android applications through use of Object Pascal. The name refers to the Delphi language as well as its libraries, compiler and IDE which is used to help edit and debug Delphi projects.

Delphi is a general-purpose language for rapid development of native Windows, OS X, Linux, iOS, and Android applications.

The name used to refer to the Delphi language, but the developers decided to return to the languages original name Object Pascal, restraining the name to the IDE, which is used to help edit and debug Delphi projects more efficiently. It is developed by Embarcadero, and is sold either as a standalone product or as part of RAD Studio, which includes other languages as well.

Delphi is an enhancement of Niklaus Wirth's language Pascal (and Object Pascal).

Delphi originated in 1995 at Borland, evolving from Turbo Pascal. It is currently owned by Embarcadero, and is the second-largest Windows development platform after Microsoft's .NET.

Among Delphi's strengths are:

  • consistent language architecture
  • a fast compiler
  • modern language constructs
  • its extensive Visual Component Library (VCL)
  • the associated visual form designer

Variants:

Some other Embarcadero products are or were released using the "Delphi" brand. A .NET product called Delphi Prism (based on PascalScript codebase) for use in MS Visual Studio allows for development using Mono, producing apps that are "cross platform" in that they will run on multiple platforms that support Mono. Delphi Prism is mostly compatible with Delphi syntax, albeit with very different libraries. The Embarcadero PHP product, formerly labelled "Delphi for PHP", and Prism are integrated in the main Embarcadero studio project RAD Studio. There is an AS/400 version of Delphi as well.

Delphi console "Hello world":

program Hello;
{$APPTYPE CONSOLE}
begin
  Writeln('Hello, World');
end.

A minimalist GUI Delphi application

program GUIHello;
uses  
  Windows;
begin
  MessageBox(0, 'Message', 'Hello, World', MB_OK);
end.

Resources:

Many SO profiles of Delphi developers point to good resources concerning Delphi. There is also an aggregation of main blogs in the field at DelphiFeeds and Begin End. Marco Cantù's books on Delphi programming provide another great resource.

Documentation

See all questions around delphi here.

References

Tagging recommendation:

There are several version-specific tags. It is recommended to use the tag together with the version-specific tag, e.g. .

Free Delphi/Pascal Programming Books

Delphi/Pascal Books

Reporting bugs, issues, new features

Delphi Forums

51211 questions
59
votes
5 answers

Why should I not use "if Assigned()" before accessing objects?

This question is a continuance of a particular comment from people on stackoverflow which I've seen a few different times now. I, along with the developer who taught me Delphi, in order to keep things safe, have always put a check if assigned()…
Jerry Dodge
  • 26,858
  • 31
  • 155
  • 327
58
votes
4 answers

How do I make Beyond Compare ignore certain differences while comparing versions of Delphi Form Files

I use Beyond Compare (version 3.1.10) to compare different versions of Delphi Form Files, but I don't want to see differences concerning ExplicitTop, ExplicitLeft, ExplicitHeight and ExplicitWidth. Details: These lines will always begin with a…
Svein Bringsli
  • 5,640
  • 7
  • 41
  • 73
58
votes
4 answers

Remote debugging with XE2 - display of strings

I'm remote debugging a large app between DElphi XE2 (update #4) and a Windows XP target. PAServer is running on the target and the application works fine and stops at breakpoints (you would NOT believe how hard just that achievement was - hint -…
Brian Frost
  • 13,334
  • 11
  • 80
  • 154
55
votes
10 answers

Delphi 2006-2010 error: "Cannot create file C:\Users\Admin\AppData\Local\Temp\EditorLineEnds.ttr"

I am getting an error after installing Delphi 2007 (Edit: This problem occurs in all Delphi versions from 2006 to 2010) that I can not figure out and have never seen before. After restarting I can launch the program without any problems, but if I…
M Schenkel
  • 6,294
  • 12
  • 62
  • 107
54
votes
2 answers

Is COM broken in XE2, and how might I work around it?

Update: XE2 Update 2 fixes the bug described below. The program below, cutdown from the real program, fails with an exception in XE2. This is a regression from 2010. I don't have XE to test on but I'd expect that the program works fine on XE (thanks…
David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
54
votes
12 answers

Profiler and Memory Analysis Tools for Delphi

I recently upgraded from Delphi 4 to Delphi 2009. With Delphi 4 I had been using GpProfile by Primoz Gabrijelcic as a profiler and Memory Sleuth by Turbo Power for memory analysis and leak debugging. Both worked well for me. But I now need new tools…
lkessler
  • 19,819
  • 36
  • 132
  • 203
54
votes
4 answers

Midi Timing Issues with Delphi ASIO VST and MiniHost

I'm coming from a background of using MSC* MidiSequencer for a Delphi XE2 project and have been playing with DelphiASIOVST this weekend on the off chance the MIDI may be stable enough to use as my core MIDI engine while also allowing me to support…
Charles R. Thompson
  • 683
  • 1
  • 6
  • 10
53
votes
6 answers

How to get the Memory Used by a Delphi Program

I know how to get the System memory use using GlobalMemoryStatusEx, but that tells me the what the entire OS is using. I really want my program to report how much memory it alone has allocated and is using. Is there any way within my Delphi 2009…
lkessler
  • 19,819
  • 36
  • 132
  • 203
53
votes
3 answers

What's the difference between Refresh, Update and Repaint?

I don't know which of those three methods suits me most. They all work for me. Does anyone know the difference between Refresh, Update and Repaint?
Ivan Prodanov
  • 34,634
  • 78
  • 176
  • 248
53
votes
1 answer

How to make TRichEdit behave like WordPad on Windows 7 when changing font for certain non-text characters?

With the help of Sertac Akyuz, it seems the direct reason is related to the charset of \bullet: In my localized Windows, the \bullet input by typing Alt(0149) always gets \fcharset134, and attempts to change its font through EM_SETCHARFORMAT always…
SOUser
  • 3,802
  • 5
  • 33
  • 63
52
votes
5 answers

Which is preferable: Free or FreeAndNil?

What is the basic difference between Free and FreeAndNil? Is FreeAndNil = Free + Nil? When should I use Free and when should I use FreeAndNil?
Bharat
  • 6,828
  • 5
  • 35
  • 56
52
votes
3 answers

Delphi: What is Application.Handle?

What is TApplication.Handle? Where does it come from? Why does it exist? And most importantly: why do all forms have it as their parent window handle? The Delphi help says: TApplication.Handle Provides access to the window handle of the main form…
Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219
51
votes
5 answers

Identifiers for Delphi's $WARN compiler directive

Delphi has a $WARN compiler directive that allows one to selectively enable or disable specific warnings. The Delphi 2009 help file describes the syntax: {$WARN identifier ON|OFF} But it only lists the identifiers for 6 warnings. I'd like to have…
Jan Goyvaerts
  • 21,379
  • 7
  • 60
  • 72
49
votes
2 answers

Why can a WideString not be used as a function return value for interop?

I have, on more than one occasion, advised people to use a return value of type WideString for interop purposes. Accessing Delphi DLL throwing ocasional exception ASP.NET web app calling Delphi DLL on IIS webserver, locks up when returning PChar…
David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
49
votes
13 answers

Standard URL encode function?

Is there a Delphi equivalent of this .net's method: Url.UrlEncode() Note I haven't worked with Delphi for several years now. As I read through the answers I notice that there are several remarks and alternatives to the currently marked answer. I…
Boris Callens
  • 90,659
  • 85
  • 207
  • 305