Welcome to the Tweaking4All community forums!
When participating, please keep the Forum Rules in mind!
Topics for particular software or systems: Start your topic link with the name of the application or system.
For example “MacOS X – Your question“, or “MS Word – Your Tip or Trick“.
Please note that switching to another language when reading a post will not bring you to the same post, in Dutch, as there is no translation for that post!
[Solved] Lazarus/Delphi - How to terminate, quit, exit or halt your application
Delphi, Lazarus, Free Pascal
(@hans)
Famed Member Admin
Joined: 12 years ago
Posts: 2869
Topic starter
February 10, 2014 9:32 AM
Normally an application is closed by closing the main form:
Form1.Close;
However, this option is not always available (for example when an application has no form, or when you're working in a formless unit).
Option1:
Application.Terminate;
Option2:
Halt;
Option2 is probably the best option (although known to generate Access Violation when developing using Delphi 6 and running the application on Windows NT 4),... Option1 does not always seem to work (for example in exception handlers).