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
1 answer

How can I receive OutputDebugString from a service?

I'm trying to catch all OutputDebugString messages (including those from services) using the following code. It worked fine until I migrated to Windows 7. The problem is that since Windows Vista services are running in the low level Session #0, some…
user532231
12
votes
3 answers

Delphi2010: Writing code to assign Caption containing Unicode literal values or load unicode symbols from text file?

How to make a Unicode program in Delphi 2010? I have English Windows and "Current language for non-Unicode programs" is English too. Static controls look good but if I try to change them (Label.Caption := 'unicode value' or…
Michael
  • 475
  • 2
  • 9
  • 17
12
votes
1 answer

TEdgeBrowser component: calling native code from a script running on the embedded web page

Currently we use TWebBrowser component to embed IE to our desktop application. To call a Delphi code from a script running in the embedded browser we have implemented support for the window.external object as described here:…
stepand76
  • 467
  • 6
  • 17
12
votes
9 answers

How does WriteLn() really work?

Since the age of the dinosaurs, Turbo Pascal and nowadays Delphi have a Write() and WriteLn() procedure that quietly do some neat stuff. The number of parameters is variable; Each variable can be of all sorts of types; you can supply integers,…
Wouter van Nifterick
  • 23,603
  • 7
  • 78
  • 122
12
votes
2 answers

How to get the local IP address using Inno Setup

How can I get user's local IP address using Inno Setup? I thought about using Win32 API GetIpAddrTable, but it is unclear how to make the adjustment. Dos someone have any other way? Or know how to do it?
Toda Raba
  • 614
  • 1
  • 10
  • 25
12
votes
2 answers

Anonymous Record constructors in delphi

Is it possible to use records as a method parameter, and call it without implicitly declaring an instance of said record? I would like to be able to write code like this. type TRRec = record ident : string; classtype : TClass; …
Fritz Deelman
  • 273
  • 2
  • 7
12
votes
5 answers

Developing Apps with Administrator Rights in Delphi

I'm using D2010 under Windows 7 to write an app that seems to require admin rights (I think because it uses COM to communicate with a third party .exe, which also requires admin rights). I've added the manifest resource as required, but when I try…
Roddy
  • 66,617
  • 42
  • 165
  • 277
12
votes
3 answers

Delphi 2010 - property wizard or something similar, to avoid manual coding getters / setters

Is there any built in or external tool (wizard) to easily add class member (published field) with getters / setters? adding each field requires me to write quite lot of code. Let's assume I need to add Foo: Bar; property. I'll need to write FFoo:…
migajek
  • 8,524
  • 15
  • 77
  • 116
12
votes
6 answers

Delphi XE - should I use String or AnsiString?

I finally upgraded to Delphi XE. I have a library of units where I use strings to store plain ANSI characters (chars between A and U). I am 101% sure that I will never ever use UNICODE characters in those places. I want to convert all other…
Gabriel
  • 20,797
  • 27
  • 159
  • 293
12
votes
1 answer

Connect to Sun LDAP with ADO

I want to connect (and get user's group) to a Sun LDAP server with a Delphi program. I think ADSI works only with Microsoft LDAP. I try it with ADO, but I can't connect. Can someone show some code how I would do this?
Partizan22
  • 129
  • 3
12
votes
5 answers

How do I hide a non-visual component on a form at design-time?

I am working on the GUI of an older program (in Delphi). Some of the forms are small and have a number of non-visual components on them (UDP servers, UDP clients etc). I'm sure I used to be able to hide/show the non-visual components on the form…
HMcG
  • 2,062
  • 4
  • 24
  • 36
12
votes
1 answer

How do you copy and paste from a THtmlViewer object?

At the moment I have the following hack: procedure TForm1.HTMLViewer1KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); begin if (Key = Word('C')) and (Shift = [ssCtrl]) then HTMLViewer1.CopyToClipboard; end; Is there a…
12
votes
2 answers

Load image from embedded resource

I am trying to assign an image(Image1) a picture at Run-time. Since I can't set a property to load from resource. So I need to load at run time. I have the code procedure TForm1.FormCreate(Sender: TObject); var RS:Tresourcestream ; begin RS :=…
Skeela87
  • 701
  • 6
  • 12
  • 17
12
votes
2 answers

Rounded and titled "TPanel" in Delphi 7

I would have a TPanel in my application but with another look. For it I want a colored title bar and the up corner rounded just like in some user interfaces like it Do you know any component or library for it ? (Prefered Open source but not only). I…
philnext
  • 3,242
  • 5
  • 39
  • 62
12
votes
7 answers

Delphi, delete folder with content

when I have subfolder in folder - this code isn't delete folders... Is there any error? procedure TForm.Remove(Dir: String); var Result: TSearchRec; Found: Boolean; begin Found := False; if FindFirst(Dir + '\*', faAnyFile, Result) = 0 then …
Emi
  • 123
  • 1
  • 1
  • 4