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
92
votes
21 answers

Split a string into an array of strings based on a delimiter

I'm trying to find a Delphi function that will split an input string into an array of strings based on a delimiter. I've found a lot from searching the web, but all seem to have their own issues and I haven't been able to get any of them to work. I…
Ryan
  • 7,733
  • 10
  • 61
  • 106
86
votes
2 answers

Is the compiler treatment of implicit interface variables documented?

I asked a similar question about implicit interface variables not so long ago. The source of this question was a bug in my code due to me not being aware of the existence of an implicit interface variable created by the compiler. This variable was…
David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
75
votes
9 answers

Why is it bad practice to call an eventhandler from code?

Say you have a menu item and a button that do the same task. Why is it bad practice to put the code for the task into one control's action event and then make a call to that event from the other control? Delphi allows this as does vb6 but realbasic…
jjb
  • 1,340
  • 1
  • 13
  • 21
73
votes
2 answers

Webview not displaying in MacOS using Delphi XE2

I have started to convert the Webview interfaces to be consumed in Delphi. I have managed to get the webkit library to load, and the interface methods that is called appears to work correctly, however, I cannot seem to display the Webview on the…
Phillip Roux
  • 1,009
  • 7
  • 12
68
votes
1 answer

Delphi XE6 link C code in iOS

I've built an App on Android using Delphi XE6 that requires C code. However on iOS I cannot make it work. I suspect the problem is related to arm/thumb status, but I am not sure. There is no problem in either system to call the C code from Pascal.…
67
votes
1 answer

BcdDivide function behave differently in Delphi XE and XE2

FmtBcd.pas has been extensively revised rewritten in Delphi XE2. In one of my projects, I have a case that uses a division operation on two Bcd values, but the two versions yield different results. In the worst case, the Delphi XE2 may throw a Bcd…
Chau Chee Yang
  • 18,422
  • 16
  • 68
  • 132
65
votes
5 answers

How Do I Choose Between the Various Ways to do Threading in Delphi?

It seems that I've finally got to implement some sort of threading into my Delphi 2009 program. If there were only one way to do it, I'd be off and running. But I see several possibilities. Can anyone explain what's the difference between these and…
lkessler
  • 19,819
  • 36
  • 132
  • 203
64
votes
5 answers

Selecting a directory with TOpenDialog

I'd really like to know the various ways I could select a directory with the TOpenDialog, whether it be downloading a new component or using what is provided by Delphi, but preferably using what is provided by Delphi. Prior to this, I have been…
ple103
  • 2,080
  • 6
  • 35
  • 50
64
votes
1 answer

Live Binding with Automatic updates in XE3 (no need to call Notify() as in XE2)

I am currently using Delphi XE2, and heard about their new Live Binding with Automatic updates in XE3 (no need to call Notify() as in XE2). in C# or in Delphi XE2 we have to implement INotifyPropertyChanged (Notify(); in Delphi), and this approach…
62
votes
17 answers

Accidentally created a virus?

I've seen it happen reasonably often: I write an application in Delphi and when I compile it, the virus-scanner tells me that I've created a virus and then immediately deletes the executable again. It's annoying but reasonable easy to fix by doing a…
Wim ten Brink
  • 25,901
  • 20
  • 83
  • 149
62
votes
9 answers

How should I prepare my 32-bit Delphi programs for an eventual 64-bit compiler?

Possible Duplicate: How to also prepare for 64-bits when migrating to Delphi 2010 and Unicode Since I believe that 64bit Delphi compiler will appear soon, I am curious if anybody knows what kind of programs that are now 32bit will compile and…
Petra
  • 803
  • 1
  • 11
  • 12
62
votes
6 answers

Delphi: StringList Delimiter is always a space character even if Delimiter is set

I am having trouble with the delimiter in the TStringList Class. Take a look: var s: string; sl: TStringList; begin sl := TStringList.Create; s := 'Users^foo bar^bar foo^foobar^barfoo'; sl.Delimiter := '^'; sl.DelimitedText := s; …
Acron
  • 1,378
  • 3
  • 20
  • 32
60
votes
8 answers

Studies of relative costs for development in different languages

Has anyone seen a recent (and fairly balanced) study into the relative costs for software development using differing languages ? I would particular like to see the relative costs of Java Vs. C# Vs. Delphi.
mmmm
  • 2,431
  • 2
  • 35
  • 56
60
votes
9 answers

Unit testing in Delphi - how are you doing it?

I'm wondering how the few Delphi users here are doing unit testing, if any? Is there anything that integrates with the IDE that you've found works well? If not, what tools are you using and do you have or know of example mini-projects that…
Drew Gibson
  • 1,624
  • 3
  • 18
  • 22
60
votes
4 answers

What's the difference between "var" and "out" parameters?

What's the difference between parameters declared with var and those declared with out? How does the compiler treat them differently (e.g., by generating different code, or by changing which diagnostics it issues)? Or do the different modifiers…
Rob Kennedy
  • 161,384
  • 21
  • 275
  • 467