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
2 answers

Delphi exception handling, use E: Exception or ExceptObject

We have 2 applications, the first one is VCL project, the other is a windows service. In the VCL project we do: try except on E: Exception do // do something with E.Message end but in the windows service (which uses several threads) we…
Lucas Steffen
  • 1,244
  • 2
  • 10
  • 22
12
votes
8 answers

Delphi PDF generation

We're using Fast Reports to create reports but we're not very happy with the quality of the PDFs it creates. I know we can plug in other PDF components instead of the one that comes with FastReports so my question is What good PDF components are…
Marius
  • 2,494
  • 6
  • 31
  • 41
12
votes
2 answers

Delphi object create inside try block?

In Delphi 7 a the creation of an object was like this: A := TTest.Create; try ... finally A.Free; end; However in a blog article Marco Cantù says that in Embercadero they use A1 := nil; A2 := nil; try A1 := TTest.Create; A2 :=…
Chopin
  • 147
  • 6
12
votes
2 answers

Multiplying two UInt32 to obtain a UInt64 without widening

For my BigIntegers, in the PUREPASCAL implementation (i.e. no assembler allowed), I must multiply two UInt32 to get an UInt64 result. The usual way to do this is to widen at least one of the operands, so you get a 64 bit multiplication: Res :=…
Rudy Velthuis
  • 28,387
  • 5
  • 46
  • 94
12
votes
1 answer

FastReport FMX 2.0 gives an error "clCantRen" when component placed on form

Whenever I put FastReport 2.0 FMX -> TfrxReport component on my FMX form (RAD Studio 10.2), I do get error message popup "clCantRen" When run without debugging I do get following error "[dcc32 Error] E2161 Error: RLINK32: Error opening file…
Ninad Avasare
  • 333
  • 2
  • 7
  • 20
12
votes
1 answer

Delphi Seattle DataSnap Client - Proxy server settings not working

I'm connecting to a DataSnap server using a generated DS client proxy class, via TDSRESTConnection. The connection works fine and I can call the server methods. I now want to connect through a proxy server, so I am setting the properties on the…
Jonathan Wareham
  • 3,357
  • 7
  • 46
  • 82
12
votes
3 answers

Delphi: How to assign dynamically an event handler without overwriting the existing event handler?

I need to loop through Components and assign an event handler (for example Dynamically assigning OnClick event for all TButton to ShowMessage('You clicked on ' + (Sender as TButton).Name); The problem is that in some cases I already assigned the…
UnDiUdin
  • 14,924
  • 39
  • 151
  • 249
12
votes
5 answers

Display simple markup in a Label in Delphi

I am currently displaying some text in a TLabel. I would now like to emphasise certain words within the text by displaying them in bold or perhaps italic. What is the recommended way to do this in Delphi? Is there a TLabel-like component that can…
awmross
  • 3,789
  • 3
  • 38
  • 51
12
votes
6 answers

Delphi serverside framework for managing sessions and respond with JSON to ajax requests?

Without reinventing the wheel, what I can use to manage user sessions in a web application and being able to respond with JSON to ajax requests? Is there some framework (made for example with Indy components or something like this)? Note for…
UnDiUdin
  • 14,924
  • 39
  • 151
  • 249
12
votes
3 answers

Deep copy of a record with R1:=R2, or Is there good way to implement NxM matrix with record?

I'm implementing a N x M matrix (class) with a record and an internal dynamic array like below. TMat = record public // contents _Elem: array of array of Double; // procedure SetSize(Row, Col: Integer); procedure Add(const M:…
benok
  • 688
  • 1
  • 6
  • 21
12
votes
3 answers

How can i remove a USB flash disk programmatically using delphi?

How can I detect and remove a USB flash disk programatically using delphi? I have seen some of the examples in this website, but they lack clear explanation on how to go about it! Please examples will really help!
Gath
  • 713
  • 4
  • 11
  • 16
12
votes
7 answers

autoscrolling memo in delphi

Does delphi contain a component that allows auto scroll text loaded from db, like in news sites? Tt's for a delphi 7 application and requires a vertical scrolling.
none
  • 4,669
  • 14
  • 62
  • 102
12
votes
5 answers

Why Delphi says 'cannot resolve unit name xxx'?

I'm working with Delphi2010 Enterprise Update 4. When I'm opening my project in the IDE and displaying the mainform code, there are 2 unit names underline in red. xxx http://img268.imageshack.us/img268/6475/unitnameunresolved.png. I have verified…
TridenT
  • 4,879
  • 1
  • 32
  • 56
12
votes
3 answers

Add a png image to a imagelist in runtime using Delphi XE

I need add in runtime a png image to a TImageList. I've looked at the functions implemented by the TCustomImageList but they only allow adding bitmaps, icons or images from another imagelist E.g.: function Add(Image, Mask: TBitmap):…
Salvador
  • 16,132
  • 33
  • 143
  • 245
12
votes
5 answers

Which is the correct way to start a suspended thread in delphi 2007?

In delphi XE I can use the start procedure, but this method does not exist in delphi 2007. This sample code works ok in delphi xe, using Start MyThread:=TMyThread.Create(True); MyThread.FreeOnTerminate …
Salvador
  • 16,132
  • 33
  • 143
  • 245