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 to auto expand all TTreeView nodes?

I want to expand tree on main form when application starts. How i can do it? I cant find corresponding property. C++ builder 2009.
Funtime
  • 2,466
  • 4
  • 20
  • 21
12
votes
5 answers

Synchronizing/sending data between threads

The app is written in Delphi XE. I have two classes, a TBoss and TWorker, which are both based of of TThread. The TBoss is a single instance thread, which starts up and then will create about 20 TWorker threads. When the boss creates a instance of…
Wizzard
  • 12,582
  • 22
  • 68
  • 101
12
votes
2 answers

Delphi: Is it possible to have a combo box with disabled items in it?

How can I have TComboBox with some items that are disabled? I need the user to see these items, but not be able to select them. Thanks!
croceldon
  • 4,511
  • 11
  • 57
  • 92
12
votes
5 answers

Delphi can't find System.dcu; what should the default path settings be?

Got this error whenever I try to compile something: "F1027 Unit not found: 'System.pas' or binary equivalents (.dcu)". Got it after installing a component, removed it, reinstalled RAD studio, but still same. In order to get it fixed, I need the…
pop33
  • 135
  • 1
  • 1
  • 5
12
votes
1 answer

How to press a button with the enter key

I have simple question. How do you press a button with your enter key? I have a login screen, where I can just login with a button. But I also want to login when pressing the enter button. How should I do this? Thanks in advance! Jasper
J Bom
  • 303
  • 1
  • 5
  • 21
12
votes
3 answers

Generic dialog with custom captions for buttons

I know this issue have been up since before (ex. Best way to show customized message dialogs), but I still don't find what I want. I started like this: class function TAttracsForm.MessageDlg(const aMsg: string; aDlgType: TMsgDlgType; Buttons:…
Roland Bengtsson
  • 5,058
  • 9
  • 58
  • 99
12
votes
7 answers

Best way to test a Delphi application

I have a Delphi application that has many dependencies, and it would be difficult to refactor it to use DUnit (it's huge), so I was thinking about using something like AutomatedQA's TestComplete to do the testing from the front-end UI. My main…
Osama Al-Maadeed
  • 5,654
  • 5
  • 28
  • 48
12
votes
6 answers

Deleting all components of a certain class on a form (Delphi)

This is probably a stupid question, but my brain is just cooked enough I think I'm going to use one of my "lifelines" to see if I can get some help from my stack overflow friends. ;) I need to delete all occurrences of a particular component type on…
Jamo
  • 3,238
  • 6
  • 40
  • 66
12
votes
1 answer

JSON vs XML parsing speed in Delphi

We are creating an application that uses a lot of XML parsing and I thought maybe to use JSON, because we can use JSON as an alternative to XML. I need to test which is faster JSON or XML, but thought to ask an opinion here first. JSON in…
evilone
  • 22,410
  • 7
  • 80
  • 107
12
votes
3 answers

Efficient data structure for GUIDs

I am in search of a data structure which enables me to quickly (prefarably O(1)-quickly) determine if a given GUID is a member of a Collection of GUIDs or not. My current approach is to use a TDictionary with 0 as values. While this works quickly,…
sum1stolemyname
  • 4,506
  • 3
  • 26
  • 44
12
votes
1 answer

TNetEncoding.Base64.Encode contains CR LF

Is this behavio(u)r intended? ... uses System.NetEncoding; ... var s: String; begin s := TNetEncoding.Base64.Encode('asjjdhgfaoösjkdhföaksjdfhöasjdfhasdkjasdhfköajsjhdfajssssd'); end; s contains a CR…
12
votes
4 answers

Delphi 2010 threads

Can someone post the simplest thread example for Delphi 2010 that for example puts some text into a memo when button clicked? With implementation and all. Thanks. Update: Ok, just a simple thread that does something. No need for a memo. Thanks.
user645976
12
votes
1 answer

How to compare TFunc/TProc containing function/procedure of object?

We use a TList> with some function ... of objects in it and now want to Remove() some of the entries again. But it doesn't work because obviously you simply can not compare these reference to ... thingies reliably. Here's some test…
kiw
  • 748
  • 1
  • 9
  • 18
12
votes
5 answers

Is there any way to catch unhandled application exceptions and log them

is there any way to catch and log all errors in application. In the moment I use try catch blocks in places where I think error can occur. But is there a possibility to catch all errors in application level (I mean, can I put try catch block to…
evilone
  • 22,410
  • 7
  • 80
  • 107
12
votes
4 answers

Delphi style: How to structure data modules for unit-testable code?

I am looking for some advice about structuring Delphi programs for maintainability. I've come to Delphi programming after a couple of decades of mostly C/C++ though I first learned to program with Turbo Pascal, so I'm not uncomfortable with the…
wades
  • 927
  • 9
  • 24