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

Is it possible to define {$IFDEF} for more than one directive at once?

Is it possible to define more than one conditional in one {$IFDEF} directive ? I would like to have syntax like this: {$IFDEF Condition1 OR Condition2} DoSomething; {$ENDIF} {$IFDEF Condition1 AND Condition2} DoSomethingElse; {$ENDIF} Thanks
Martin Reiner
  • 2,167
  • 2
  • 20
  • 34
48
votes
4 answers

Best way to do non-flickering, segmented graphics updates in Delphi?

I thought I could just throw this out there and just ask: I have seen Delphi controls that are flawless in terms of graphical effects. Meaning: no flickering, sectioned updates (only redraw the section of a control that is marked as dirty) and…
Jon Lennart Aasenden
  • 3,920
  • 2
  • 29
  • 44
48
votes
12 answers

Recommendations for a scripting or plugin language for highly math-dependent user coding?

I have started a bounty for this question ...because I really want the community's input. I can (and have) looked at several languages / frameworks and think 'well, this will probably work okay' -- but I would really appreciate advice…
David
  • 13,360
  • 7
  • 66
  • 130
48
votes
4 answers

Create a constant array of strings

Is there a way in Delphi declaring an array of strings such as following one? {'first','second','third'}
none
  • 4,669
  • 14
  • 62
  • 102
47
votes
3 answers

Recommendations for a docking library for Delphi / C++Builder?

My team is currently thinking of moving our existing MDI-based application to a more modern, docking-based approach. We're still thinking, but we'd like to move it to something like VS2010's docking and visual look: This has the following…
David
  • 13,360
  • 7
  • 66
  • 130
47
votes
12 answers

Why would a Delphi programmer use Lazarus as the IDE instead of using Delphi's IDE?

I've been very happy with the Delphi IDE for programming in Delphi. But I've heard about the Lazarus programming environment, and I've also heard that some Delphi programmers use it instead of the Delphi IDE. What are the advantages that Lazarus…
lkessler
  • 19,819
  • 36
  • 132
  • 203
46
votes
4 answers

Why variables are declared as TStrings and created as TStringList?

Why variables are declared as TStrings and created as TStringList? eg: the var sl is declared as TStrings but created as TStringList var sl : TStrings; begin sl := TStringList.Create; // add string values... sl.Add( 'Delphi' ); sl.Add(…
Fabio Vitale
  • 2,257
  • 5
  • 28
  • 38
46
votes
5 answers

Buffered files (for faster disk access)

I am working with large files and writing directly to disk is slow. Because the file is large I cannot load it in a TMemoryStream. TFileStream is not buffered so I want to know if there is a custom library that can offer buffered streams or should I…
Gabriel
  • 20,797
  • 27
  • 159
  • 293
45
votes
2 answers

What is the difference between the new TFileOpenDialog and the old TOpenDialog?

What is the difference between the new TFileOpenDialog and the old TOpenDialog? In my computer (Win 7/DXE), when I run the code, the dialogs look the same.
Gabriel
  • 20,797
  • 27
  • 159
  • 293
45
votes
3 answers

How does one escape characters in Delphi string

Delphi strings use single quotes, for example 'a valid string'. How does one specify the ' character within a literal string? How would one refer to the null byte (Unicode code point U+0000)?
Boaz
  • 25,331
  • 21
  • 69
  • 77
45
votes
8 answers

What's the simplest way to call Http GET url using Delphi?

There's a web services I want to call in my application, I can use it with importing the WSDL or by just use "HTTP GET" with the URL and parameters, so I prefer the later because it's simple thing. I know I can use indy idhttp.get, to do the job,…
Mohammed Nasman
  • 10,992
  • 7
  • 43
  • 68
45
votes
1 answer

Compiler bug when using generics and forward declaration in Delphi XE2

I started project on Delphi 2010, then migrated to XE and now I try to migrate to XE2. After compiling in XE2 (Update 4 Hotfix 1), unit tests began fail with AV. After some debugging, it became clear that the following code is not correctly…
Chaa
  • 486
  • 3
  • 9
44
votes
1 answer

Published interface properties bug and workarounds

I wrote a set of components that link to each other via published interface properties. They are registered and installed in a design package. Using published interface properties is not that common in Delphi, and thus, unsurprisingly, doesn't seem…
user219760
44
votes
3 answers

Serious FireMonkey performance issues when there are a lot of controls at screen

It's already a while we are working with FireMonkey at office. After a while we noticed it wasn't exactly so lightning fast due to GPU acceleration as Embarcadero tells us. So we built a basic application just for testing FireMonkey performance.…
nexial
  • 399
  • 1
  • 3
  • 7
44
votes
4 answers

How do I sort a generic list using a custom comparer?

I'm kinda a Delphi-newbie and I don't get how the Sort method of a TList of Records is called in order to sort the records by ascending integer value. I have a record like the following: type TMyRecord = record str1: string; str2:…
p1.e
  • 497
  • 1
  • 4
  • 5