System.ExitCode

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

ExitCode: Integer = 0;    { Program result }

C++

extern DELPHI_PACKAGE int ExitCode;

Properties

Type Visibility Source Unit Parent
variable public
System.pas
System.hpp
System System

Description

Contains the application's exit code.

In Delphi code, the ExitCode variable contains the application's exit code. An exit procedure can learn the cause of termination by examining ExitCode. If the program terminates normally, ExitCode is zero. If the program terminates due to a call to Halt, ExitCode contains the value passed to Halt. If the program terminates due to a run-time error, ExitCode contains the error code.

Note: Setting the ExitCode variable to a value other than 0 in the initialization section of a unit will make loading of a DLL fail (DllMain will return False). You can also set ExitCode in code called from DLLProc or DLLProcEx to signal failure of loading.

See Also