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
12
votes
1 answer

Is it "supported" to call method on nil reference in Delphi?

The following Delphi program calls method upon nil reference and runs fine. program Project1; {$APPTYPE CONSOLE} type TX = class function Str: string; end; function TX.Str: string; begin if Self = nil then begin Result := 'nil' …
SOUser
  • 3,802
  • 5
  • 33
  • 63
12
votes
3 answers

Delphi: How to implement QueryInterface of IUnknown?

In Delphi, IUnknown is declared as: function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall; Note: The output parameter is untyped In my TInterfacedObject descendant i need to handle QueryInterface, so i can return an object that…
Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219
12
votes
4 answers

Forward declarations for record types (or arrays)

I want to do this in XE5: type TMyRec = record // fields class function GetList: TMyRecArr; static; end; TMyRecArr = array of TMyRec; I've already seen "Forward declarations for record types" and "how to do a typed forward…
saastn
  • 5,717
  • 8
  • 47
  • 78
12
votes
2 answers

How to reset the download when the GetIt package manager fails?

I tried to download the OmniThread lib via GetIt when Delphi crashed. Other packages downloaded, compiled and installed just fine, so I guess it's a once off. Now GetIt refuses to install OmniThread, because it sees the partial download, assumes all…
Johan
  • 74,508
  • 24
  • 191
  • 319
12
votes
4 answers

Detect an internet connection activation with Delphi

I've been using a 3G wireless card for a while and every time I connect, my anti-virus fires up the updates. I'm wondering what is the Win32 API set of functions that I can use to, either, get notified or query about the event of an Internet…
Gustavo Carreno
  • 9,499
  • 13
  • 45
  • 76
12
votes
1 answer

What is the difference between Owner and Parent of a control?

I am bit curious about the two properties of a Delphi VCL control. Each component has 2 properties as Owner and Parent at runtime. Can anyone help me to understand the difference between both? And how are they used by windows for displaying control…
A B
  • 1,461
  • 2
  • 19
  • 54
12
votes
5 answers

Delphi {$IFDEF CONSOLE} Problem

I just tried program Project1; {$APPTYPE CONSOLE} uses SysUtils; begin {$IFDEF CONSOLE} beep; {$ENDIF} end. and expected to hear a beep during runtime, but not. The following test works, though: if IsConsole then beep; Why…
12
votes
8 answers

Where can I find a "Turbo" or "Lite" version of Delphi?

I have a co-worker with a strong background in Ruby that is interested in getting started with Delphi and native development. However, I understand that Turbo Delphi (based on Delphi 2006) is no longer available for download. So...where does that…
Mick
  • 13,248
  • 9
  • 69
  • 119
12
votes
5 answers

Set Delphi 7 project "Version Info" from code?

Is it possible to set the "Version Info" settings from code? I'd like to set the version numbering and the value for the "Comments" property without using the project options dialog.
devployment
  • 2,121
  • 1
  • 22
  • 33
12
votes
2 answers

Do I need to free these objects?

I'm using Delphi 1 16-bit to learn Pascal (don't laugh, it works fine, plus I can't afford a more recent version). I'm using a TList to hold object references for a simple address book. Each object is added to the TList like…
FrankCM
  • 207
  • 1
  • 7
12
votes
7 answers

Delphi adding {$R *.res} in the .dpr file

Delphi sometimes adds {$R *.res} in front of the unit path in the .dpr file uses clauses, then I get a duplicated resources warning when trying to compile. Anyone knows why the hell Delphi does that? I'm using Delphi 2009 but this happens since…
Fabio Gomes
  • 5,914
  • 11
  • 61
  • 77
12
votes
7 answers

How to find a dangling interface that causes an AV in Delphi

I've a complex application to which I've just introduced some changes, adding a couple of new classes with interfaces and deleting some others. Functionally it all works but I get an access violation just after the Destroy procedure of a…
Brian Frost
  • 13,334
  • 11
  • 80
  • 154
12
votes
1 answer

Are we responsible for drawing the caption when using Windows API to draw a Button?

Introduction I have been having a little fun with the Windows API and Parts and States and seeing how the controls can be painted onto a canvas. With a lot of trial and error I managed to come up with this procedure which will draw a button onto a…
Craig
  • 1,874
  • 13
  • 41
12
votes
2 answers

How to correctly have modeless form appear in taskbar

I am trying to achieve the age-old Delphi dream of having a modeless form appear in the taskbar. What is the correct way to have a modeless form appear in the taskbar? Research Effort These are my attempts to solve the problem. There are a lot of…
Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219
12
votes
6 answers

Tools to generate unit dependencies for Delphi

Are there any tools that can generate dependency diagrams for Delphi units taking into account conditional compilation directives. I'd like to emphasize that this should be unit dependency diagram, not class dependency. Also it would be nice to have…
Max
  • 19,654
  • 13
  • 84
  • 122
1 2 3
99
100