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

Why does CreateProcess give error 193 (%1 is not a valid Win32 app)

The code below fails to start documents. I get error 193 (%1 is not a valid Win32 app). Starting executables work fine. The files are properly associated, they start the corresponding app when double clicked. I have searched SO and elsewhere for the…
Jan Doggen
  • 8,799
  • 13
  • 70
  • 144
35
votes
2 answers

Strange [number]s in Delphi DFM files - origin and necessity?

I need to change a large number of Delphi components defined in one package to similar ones in another package. Much of the grunt work can be done by replacing text (component types and properties) in the DFM files - saved as text of course. I have…
Jan Doggen
  • 8,799
  • 13
  • 70
  • 144
35
votes
2 answers

Firemonkey (FMX) bitmap and colours

Assume I have a small bitmap in Firemonkey (say 32x24 pixels). So I put a TImage onto a form and in the constructor there is this code: Image1.Bitmap.Create(32, 24); if Image1.Bitmap.Canvas.BeginScene then try …
Jason
  • 2,572
  • 3
  • 34
  • 41
34
votes
6 answers

How to make a combo box with fulltext search autocomplete support?

I would like a user to be able to type in the second or third word from a TComboBox item and for that item to appear in the AutoSuggest dropdown options For example, a combo box contains the items: Mr John Brown Mrs Amanda Brown Mr Brian Jones …
Brendanator
  • 833
  • 1
  • 8
  • 15
34
votes
4 answers

How to ensure only a single instance of my application runs?

Is there support in the Delphi XE VCL for ensuring only a single instance of an application is running? In the past, I've used library code to control a Mutex which has always seemed complicated. As I'm starting a new project in Delphi XE, I wonder…
mj2008
  • 6,647
  • 2
  • 38
  • 56
34
votes
11 answers

ORM for DELPHI win32

Does anyone know about an ORM or something similar for Delphi Win32.
Jlouro
  • 4,515
  • 9
  • 60
  • 91
34
votes
5 answers

Calling a Delphi DLL from a C# .NET application

EDIT: I've posted a better implementation of this, below. I left this here so the responses would make sense. I've done numerous searches for the correct method for writing a DLL in Delphi, and being able to call it from C#, passing and returning…
Dan Thomas
  • 831
  • 1
  • 7
  • 11
34
votes
1 answer

What is TMonitor in Delphi System unit good for?

After reading the articles "Simmering Unicode, bring DPL to a boil" and "Simmering Unicode, bring DPL to a boil (Part 2)" of "The Oracle at Delphi" (Allen Bauer), Oracle is all I understand :) The article mentions Delphi Parallel Library (DPL), lock…
mjn
  • 36,362
  • 28
  • 176
  • 378
34
votes
5 answers

A standalone Delphi application that can also be installed as windows service

In Delphi you can create a standalone Windows VCL Forms application. You can also create a Windows service application. Is it possible to combine the two in a single application that can run as a standalone application and can also be installed as a…
Vic
  • 935
  • 2
  • 14
  • 21
34
votes
7 answers

Getting size of a file in Delphi 2010 or later?

Delphi 2010 has a nice set of new file access functions in IOUtils.pas (I especially like the UTC versions of the date-related functions). What I miss so far is something like TFile.GetSize (const Path : String) What is the Delphi 2010-way to get…
jpfollenius
  • 16,456
  • 10
  • 90
  • 156
34
votes
5 answers

Object Pascal vs Delphi?

Whats the difference between Object Pascal and Delphi? Are they the same thing? What are the differences and similarities between them and which one is more useful?
Tracing
  • 343
  • 1
  • 3
  • 4
34
votes
3 answers

What are the reasons to use TArray instead of Array of T?

I'm migrating a legacy Delphi application to Delphi-XE2, and I'm wondering if there's a good reason to replace the arrays defined as Array of MyType to TArray. So the question is what are the pros and cons of TArray usage instead of …
Salvador
  • 16,132
  • 33
  • 143
  • 245
33
votes
3 answers

How can I mark a property as deprecated in delphi?

I want to mark a property in Delphi as deprecated for removal later. According to the Delphi documentation deprecated may be appended to any declaration, but it's not working for properties. Is there a way to do this? This is what I tried: property…
Trellmor
  • 634
  • 1
  • 7
  • 15
33
votes
14 answers

Delphi: How to organize source code to increase compiler performance?

I'm working on a large delphi 6 project with quite a lot of dependancies. It takes several minutes to compile the whole project. The recompilation after a few changes is sometimes much more longer so that it is quicker to terminate Delphi, erase all…
Name
  • 3,430
  • 4
  • 30
  • 34
33
votes
7 answers

Converting TMemoryStream to 'String' in Delphi 2009

We had the following code prior to Delphi 2009: function MemoryStreamToString(M : TMemoryStream): String; var NewCapacity: Longint; begin if (M.Size = > 0) or (M.Memory = nil) then Result:= '' else begin if…
dmillam
  • 373
  • 1
  • 4
  • 8