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
33
votes
5 answers

Find the last occurrence of char in a string

Does there exist any RTL Delphi function to determine the position of the last occurrence of a char in a string?
DelphiNewbie
  • 769
  • 3
  • 9
  • 14
33
votes
10 answers

Best way to sort an array

Say I have an array of records which I want to sort based on one of the fields in the record. What's the best way to achieve this? TExample = record SortOrder : integer; SomethingElse : string; end; var SomeVar : array of TExample;
Marius
  • 2,494
  • 6
  • 31
  • 41
33
votes
6 answers

How to access private methods without helpers?

In Delphi 10 Seattle I could use the following code to work around overly strict visibility restrictions. How do I get access to private variables? type TBase = class(TObject) private FMemberVar: integer; end; And how do I get access…
Johan
  • 74,508
  • 24
  • 191
  • 319
33
votes
8 answers

What's the difference between public and published class members in Delphi?

Please could someone explain me what's the difference between public and published class members in Delphi? I tried to look at Delphi help and I understand that these members have the same visibility, but I don't understand very well how they differ…
Ondra C.
  • 2,492
  • 3
  • 33
  • 35
33
votes
9 answers

How to track down access violation "at address 00000000"

I know how to create a .map file to track down access violation errors when the error message includes an actual address. But what if the error message says Access violation at address 00000000. Read of address 00000000. Where do I start looking…
ObiWanKenobi
  • 14,526
  • 11
  • 45
  • 51
33
votes
4 answers

How to detect inactive user

How to detect inactive (idle) user in Windows application? I'd like to shutdown application when there hasn't been any input (keyboard, mouse) from user for certain period of time.
Harriv
  • 6,029
  • 6
  • 44
  • 76
33
votes
12 answers

Is there, or is there ever going to be, a conditional operator in Delphi?

I kept my hands off Delphi for too long, I guess; busied myself with Java and PHP a lot over the last couple of years. Now, when I got back to doing a little Delphi job, I realised I really miss the conditional operator which is supported by both…
Peter Perháč
  • 20,434
  • 21
  • 120
  • 152
33
votes
1 answer

Can a Windows dll retrieve its own filename?

A Windows process created from an exe file has access to the command string which invoked it, including its file's path and filename. eg. C:\MyApp\MyApp.exe --help. But this is not so for a dll invoked via LoadLibrary. Does anyone know of a way for…
Blorgbeard
  • 101,031
  • 48
  • 228
  • 272
33
votes
2 answers

Interfaces and properties

Is it possible to declare a property in an interface without declaring the get- and set-methods for it? Something like: IValue = interface property value: double; end; I want to state that the implementor should have a property called value,…
Vegar
  • 12,828
  • 16
  • 85
  • 151
33
votes
2 answers

Rotate bitmap by real angle

Once upon a time, reading this question, I wondered how to rotate a bitmap by any degree without fiddling around with all the bits myself. Recently, someone else had obvious difficulties with it too. There are already many questions dealing with…
NGLN
  • 43,011
  • 8
  • 105
  • 200
32
votes
5 answers

What is the fastest XML Parser available for Delphi?

We have reasonably large XML strings which we currently parse using MSXML2 I have just tried using MSXML6 hoping for a speed improvement and have got nothing! We currently create a lot of DOM Documents and I guess there may be some overhead in…
Paul
  • 2,773
  • 7
  • 41
  • 96
32
votes
2 answers

Why is drawing a line less than 1.5 pixels thick twice as slow as drawing a line 10 pixels thick?

I'm just playing around with FireMonkey to see if graphical painting is any faster than GDI or Graphics32 (my library of choice at the moment). To see how fast it is, I've performed some tests, but I run into some odd behaviour: Drawing thin lines…
Wouter van Nifterick
  • 23,603
  • 7
  • 78
  • 122
32
votes
1 answer

How can I customize the DUnit test case classes generated by the Test Case wizard?

After poking around in the files installed by Delphi, I have found a file "C:\Program Files\Embarcadero\RAD Studio\7.0\ObjRepos\en\UnitTestFrameworks.xml" This file has a number of sections for setting options that affect the test case code…
lukeck
  • 4,528
  • 3
  • 27
  • 29
32
votes
8 answers

How to open an URL with the default browser with FireMonkey cross-platform applications?

Usually, I use: ShellExecute(0, 'OPEN', PChar(edtURL.Text), '', '', SW_SHOWNORMAL); How can I have the same behaviour (opening a link in the default browser), on all platforms (Windows and OSX)?
Whiler
  • 7,998
  • 4
  • 32
  • 56
32
votes
1 answer

Which language elements can be annotated using attributes language feature of Delphi?

Delphi 2010 introduced custom attributes which can be added to type declarations and methods. For which language elements can a custom attribute be used? The examples which I have found so far include class declarations, fields and methods. (And…
mjn
  • 36,362
  • 28
  • 176
  • 378