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 to detect ctrl-t keypress in Delphi

I have a Win32 form with a TEdit control. When the user presses CTRL-t while the TEdit control is in focus, I want to detect it using the OnKeyUp event. I need a code example, please, using the Key and/or Shift variables. Thanks.
kenalacom
  • 261
  • 2
  • 6
  • 15
12
votes
5 answers

What do I have to do to make my WH_SHELL or WH_CBT hook procedure receive events from other processes?

I'm trying to use SetWindowsHookEx to set up a WH_SHELL hook to get notified of system-wide HSHELL_WINDOWCREATED and HSHELL_WINDOWDESTROYED events. I pass 0 for the final dwThreadId argument which, according to the docs, should "associate the hook…
Oliver Giesen
  • 9,129
  • 6
  • 46
  • 82
12
votes
3 answers

How can I configure the new Delphi XE8 Editor begin-end visual cues?

The Delphi XE8 editor has visual cues so that you know which begin goes with which end. In our team, we have the convention of always put the begin on the same line as the owner clause. Is there any way to have the visual cue aligned with the…
Pep
  • 1,957
  • 2
  • 24
  • 40
12
votes
3 answers

Does TAction.OnUpdate event degrade the performance?

In Delphi XE7, I use this trick to automatically enable or disable a toolbar button ("Edit ListView Item") according to whether an item in the ListView is selected or not, to prevent the user to click on the button if there is no ListView Item…
user1580348
  • 5,721
  • 4
  • 43
  • 105
12
votes
10 answers

Where to store program settings instead of HKEY_LOCAL_MACHINE?

I have some program settings that are currently stored in HKEY_LOCAL_MACHINE. Due to Vista and locked down users, some users don't have permission to HKEY_LOCAL_MACHINE, and those values don't really belong to HKEY_LOCAL_USER either (it has to be…
Robo
  • 4,588
  • 7
  • 40
  • 48
12
votes
1 answer

Disabling the form still allow childs controls to receive input

I'm having a lot of headache in the last days with delphi, what im trying to do is a lot simple, block the interface at somepoint and enable after some other point. But as simply as it sound i couldn't figure out why somethings are allowed by…
kabstergo
  • 761
  • 4
  • 16
12
votes
7 answers

Delphi: Alternative to using Reset/ReadLn for text file reading

i want to process a text file line by line. In the olden days i loaded the file into a StringList: slFile := TStringList.Create(); slFile.LoadFromFile(filename); for i := 0 to slFile.Count-1 do begin oneLine := slFile.Strings[i]; //process…
Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219
12
votes
4 answers

Is possible to mark an entire const block as deprecated?

I know you can mark a single constant as deprecated using const NotDeprConst1 = 1; DeprConst = 2 deprecated; NotDeprConst2 = 2; But, can you mark a whole const block as deprecated without marking the constants one by one? I would like to do…
Daniel Santos
  • 1,451
  • 15
  • 38
12
votes
5 answers

Avoiding "variable might not have been initialized"

I recently ran across a routine that looks something like this: procedure TMyForm.DoSomething(list: TList; const flag: boolean); var local: integer; begin if flag then //do something else local :=…
Mason Wheeler
  • 82,511
  • 50
  • 270
  • 477
12
votes
2 answers

Using TBitmapLinks with the FireMonkey Style Designer

I have been styling FireMonkey controls, but there is one issue that I have been having some real issues with, and that is how to incorporate bitmaps into FireMonkey styles using the FireMonkey Style Designer (and specifically not the Bitmap Style…
Cary Jensen
  • 3,751
  • 3
  • 32
  • 55
12
votes
3 answers

Why FreeAndNil implementation doing Nil before Free?

If you will look at the code of FreeAndNil procedure you will see: procedure FreeAndNil(var Obj); var Temp: TObject; begin Temp := TObject(Obj); Pointer(Obj) := nil; Temp.Free; end; What is the reason they assigning Nil to an object…
Andrew
  • 3,696
  • 3
  • 40
  • 71
12
votes
2 answers

Position of label caption inside ProgressBar

I want to put a label inside progress bar. And this label caption is dynamic. How can I get the label position ALWAYS on center inside the ProgressBar? What I've tried ; Label1.Parent := progressBar1; Label1Top := progressBar1.Height div 2; …
Bianca
  • 973
  • 2
  • 14
  • 33
12
votes
1 answer

Generics not resolving method types correctly

Consider the following : {$APPTYPE CONSOLE} uses Generics.Collections; type TObjProc = procedure of object; TFoo = class public procedure DoFoo; public procedure DoBar; end; procedure TFoo.DoFoo; begin …
J...
  • 30,968
  • 6
  • 66
  • 143
12
votes
4 answers

Why does my Delphi program's memory continue to grow?

I am using Delphi 2009 which has the FastMM4 memory manager built into it. My program reads in and processes a large dataset. All memory is freed correctly whenever I clear the dataset or exit the program. It has no memory leaks at all. Using the…
lkessler
  • 19,819
  • 36
  • 132
  • 203
12
votes
9 answers

Delphi Change main form while application is running

I have this problem. When I hide my main form, then the taskbar icon of my application is also hidden. I saw a new question about this problem as well and the answers didn't really help. They suggested to minimize it, but I do not want to minimize…
Shaun Roselt
  • 1,650
  • 5
  • 18
  • 44
1 2 3
99
100