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

Is there a way to instantiate a class by its name in delphi?

I'd like to instantiate a class but I only have its name in a string. Is there a way?
Ricardo Acras
  • 35,784
  • 16
  • 71
  • 112
12
votes
3 answers

Structured Exception Handler and Delphi

I am trying to set SEH without using try except (This is for my own personal knowledge to get a better idea on how SEH works) The following code doesn't work type TSeh = packed record OldSeh:DWORD; NewSeh:DWORD; end; procedure…
opc0de
  • 11,557
  • 14
  • 94
  • 187
12
votes
7 answers

Newline character in caption of button

I am building an application in which I want to display a button on a form. I want to display the Caption of the button on two lines. I have tried using the following code in the form's OnCreate event but it is not showing the new…
naren
  • 629
  • 4
  • 15
  • 22
12
votes
1 answer

Is there a Delphi EncodeDate/DecodeDate function version that can handle B.C. dates?

The Delphi functions EncodeDate/DecodeDate seem to be able to handle only dates after 1.1.0001. Are there some implementations of EncodeDate/DecodeDate that can handle B.C. tDateTime values?
blerontin
  • 2,892
  • 5
  • 34
  • 60
12
votes
4 answers

Delphi - How to use more defined values in conditional compilation

Can I combine some IFDEFS in my source? For example: {$IFDEF INCOMING or OUTGOING} ... {$ENDIF} Thanks for your help: dd
durumdara
  • 3,411
  • 4
  • 43
  • 71
12
votes
6 answers

Delphi.Personality is not avaliable

Recently, I get this error, and all Delphi-related project/file creation items are missing: The project can not be loaded because the required personality Delphi.Personality is not available.. What I need to do is select "Manage Platform" and then…
Kenny Choi
  • 133
  • 1
  • 6
12
votes
4 answers

Techniques and tools for debugging problems on remote machines?

Users have been reporting problems/crashes/bugs that I can't reproduce on my machine. I'm finding these problems difficult to fix. I've started using EurekaLog (fantastic!) and SmartInspect. Both these tools have helped greatly but I'm still…
Shannon Matthews
  • 9,649
  • 7
  • 44
  • 75
12
votes
6 answers

Strings in a separate .pas file

This may not be the correct place for this question, if not feel free to move it. I tagged as Delphi/Pascal because it's what I am working in atm, but this could apply to all programming I guess. Anyway I am doing some code cleanup and thinking of…
James West
  • 771
  • 1
  • 14
  • 26
12
votes
4 answers

Delphi - Threading frameworks

I am looking for a Threading framework to use in my Delphi application. Currently I am evaluating ‘OmniThreadLibrary’ - so far it looks good and does everything I need. Is there any other ‘Threading framework’ for Delphi ? (I am using D2006 &…
Charles Faiga
  • 11,665
  • 25
  • 102
  • 139
12
votes
8 answers

How to take a screenshot of the Active Window in Delphi?

For full screenshots, I use this code: form1.Hide; sleep(500); bmp := TBitmap.Create; bmp.Height := Screen.Height; bmp.Width := Screen.Width; DCDesk := GetWindowDC(GetDesktopWindow); BitBlt(bmp.Canvas.Handle, 0, 0, Screen.Width, Screen.Height,…
PuppyKevin
  • 2,967
  • 7
  • 25
  • 27
12
votes
3 answers

Compiler warning "return value might be undefined"

I often use code along the lines of: function GetNumber(Handle : THandle) : Integer; begin FLock.BeginRead; try if FMap.TryGetValue(Handle, Object) then raise EArgumentException.Create('Invalid handle'); Result := Object.Number; finally …
jpfollenius
  • 16,456
  • 10
  • 90
  • 156
12
votes
2 answers

How do I create a window with different Aero glass frame?

I think there is a customized window style in Windows 7. like this : And as you can see it's different from normal style : How can i create a window with the style that you can see in the first picture ?
Kermia
  • 4,171
  • 13
  • 64
  • 105
12
votes
4 answers

Difference between CompareStr and '=' for Strings in Delphi

I just want to know the difference between CompareStr and = for comparing strings in Delphi. Both yield the same result. if(str2[i] = str1[i]) then ShowMessage('Palindrome') if(CompareStr(str2[i], str1[i]) = 0) then …
CyprUS
  • 4,159
  • 9
  • 48
  • 93
12
votes
1 answer

Android's TMemo (Firemonkey) Issue and strange behaviour

Using Tmemo in my application, to allow the user to enter notes, I found that when editing the text or using the backspace key, very strange things happen. For example, it's not possible to move the cursor to the end of the text, or deleting some…
Gianluca Colombo
  • 717
  • 17
  • 38
12
votes
3 answers

Execute an EXE File from Resource into Memory

I want to execute an EXE File that is compiled with my application as a Resource. I want to execute it directly in Memory. I have seen this Topic : Is it possible to embed and run exe file in a Delphi executable app? And this Code…
Mahmood_N
  • 521
  • 9
  • 20