Skip to content

TCustomApplication.Terminate

Terminate the application.

Declaration

Source position: custapp.pp line 79

public 
procedure Terminate;  virtual;

procedure Terminate(AExitCode: Integer);  virtual;

Description

Terminate sets the Terminated property to True. By itself, this does not terminate the application. Instead, descendent classes should in their DoRun method, check the value of the Terminated property and properly shut down the application if it is set to True.

When AExitCode is specified, it will passed to System.ExitCode, and when the program is halted, that is the exit code of the program as returned to the OS. If the application is terminated due to an exception, ExceptionExitCode will be used as the value for this argument.

See also

Name Description
TCustomApplication.Terminated Was Terminate called or not.
TCustomApplication.Run Runs the application.
ExceptionExitCode ExitCode to use then terminating the program due to an exception.
System.ExitCode