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
3 answers

How can I temporarily disable the "return value might be undefined" warning?

I want to disable a specific warning (W1035) in my code, since I think that the compiler is wrong about this warning: function TfrmNagScreen.Run: TOption; begin if ShowModal = mrOk then Result := TOption(rdgAction.EditValue) else …
Jens Mühlenhoff
  • 14,565
  • 6
  • 56
  • 113
12
votes
2 answers

Balloon hints on Delphi app tray icon keep popping up indefinitely

I have a Delphi 2006 app that can minimize to a tray icon, and displays various alert messages via a balloon hint over the tray icon. Under some circumstances - I don't know when - a previously displayed balloon hint keeps popping up and won't go…
rossmcm
  • 5,493
  • 10
  • 55
  • 118
12
votes
8 answers

How to automatically free classes/objects?

What techniques exist to automatically free objects in delphi applications?
Shannon
  • 169
  • 2
  • 8
12
votes
2 answers

Why not raise EInvalidPointer?

The Delphi documentation states : Never raise an EInvalidPointer exception directly. EInvalidPointer is raised internally by the memory manager. I'm writing a custom base class as an alternative to TInterfacedObject, following the RTL…
J...
  • 30,968
  • 6
  • 66
  • 143
12
votes
4 answers

Delphi: writing to the private ancestor's field in descendant class

I need to fix a third-party component. This component's class has private variable which is actively used by its descendants: TThirdPartyComponentBase = class private FSomeVar: Integer; public ... end; TThirdPartyComponent = class…
Andrew
  • 3,696
  • 3
  • 40
  • 71
12
votes
5 answers

Ultimate guide to Debug in Delphi

Is there a complete resource for debugging in Delphi that instructs on how to use all the IDE debugging tools? There used to be a guide from Marco Cantù but it was updated to Delphi 5 if I am not wrong. May you please redirect me to a complete…
UnDiUdin
  • 14,924
  • 39
  • 151
  • 249
12
votes
3 answers

How to show a TPopupMenu when you click a TButton?

I want to show a popupmenu when click a button, but this procedure has error in Delphi XE. procedure ShowPopupMenuEx(var mb1:TMouseButton;var X:integer;var Y:integer;var pPopUP:TPopupMenu); var popupPoint : TPoint; begin if (mb1 = mbLeft) then…
return
  • 1,049
  • 5
  • 17
  • 27
12
votes
2 answers

Any information on a Turbo Delphi 2009 release?

Individually, the Turbo Delphi releases and the new improvements added in Delphi 2009 are two of the best things that have happened to Delphi in a long time. But currently you can only get one or the other. Does anyone know if Embarcadero has any…
Mason Wheeler
  • 82,511
  • 50
  • 270
  • 477
12
votes
2 answers

Why an application starts with FPU Control Word different than Default8087CW?

Could you please help me to understand what is going on with FPU Control Word in my Delphi application, on Win32 platform. When we create a new VCL application, the control word is set up to 1372h. This is the first thing I don't understand, why it…
Wodzu
  • 6,932
  • 10
  • 65
  • 105
12
votes
9 answers

How reliable is the Random function in Delphi

I am writing a program which write statistical tests in Delphi (must be Delphi) and I've heard that the Random functionality is somewhat odd. You have to call randomize to randomize the seed of the random function when the program starts. I'm…
Daisetsu
  • 4,846
  • 11
  • 50
  • 70
12
votes
1 answer

Why am I able to access private class variables from outside the class, and how can I prevent it?

I am using this code type TSomeClass = class(TOBject) private class var InstanceCount : integer; class var TotalInstanceCount : integer; public class function instances: integer; class function totalInstances: integer; constructor…
Raffaele Rossi
  • 2,997
  • 4
  • 31
  • 62
12
votes
1 answer

Can I step into the VCL (Pascal) code while debugging a C++ app?

I have a Delphi app that we're migrating to C++. One thing I often do while debugging my Delphi code is step into the VCL itself to understand exactly what's going on, to track some bugs. Is this possible in C++Builder? Suppose I am in C++Builder…
C. Smith
  • 149
  • 5
12
votes
2 answers

"specific to a platform" warning in Delphi 6 on Windows 7

We have some legacy code that compiles in Delphi 6. There are plans to rewrite it in a more current IDE, but they are a ways out. When we compile it we get several warnings like this: FPrecision is specific to a platform. This is in VCL\DB.pas. …
Vaccano
  • 78,325
  • 149
  • 468
  • 850
12
votes
6 answers

Delphi: How to hide ancestor constructors?

Update: gutted the question with a simpler example, that isn't answered by the originally accepted answer Given the following class, and its ancestor: TComputer = class(TObject) public constructor Create(Teapot: string=''); end; TCellPhone =…
Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219
12
votes
5 answers

Handling a Unicode String in Delphi Versions <= 2007

Background: This question relates to versions of Delphi below 2009 (ie without Unicode support built in). I have a specification that requires me to transmit a Unicode encoded string over a TCP connection but I do not have Delphi 2009. Question Is…
jamiei
  • 2,006
  • 3
  • 20
  • 28