The procedure forces an abrupt termination of the current application.
Warning : resources cannot be guaranteed to be freed when calling halt.
Optionally, the ExitCode variable may be set by passing an ExitValue. This code is returned to the application invoker as the return code from the application.
If ErrorAddr has been assigned a value, when is called, a dialog is displayed showing the Halt ErrorAddr and ExitCode values.
After executes, the Halt finalization section of the unit is executed before the program actually terminates.
Warning : use only in exceptional circumstances.
Forces a jump out of a single loop
Forces a jump to the next iteration of a loop
Exit abruptly from a function or procedure
Sets the return code when an application terminates
Forces a jump to a label, regardless of nesting
Terminates the program with an error dialog
Aborts the current processing with a silent exception
Buy Website Traffic at Buywebsitetrafficexperts.com
Buy Proxies at Buyproxies.io
this web site as a Windows program.
Example code : Halt a program with an error dialog
i : Integer;
begin // Set up an error address so that halt shows a termination dialog
ErrorAddr := Addr(i);
// Stop the program with exit code 4
// The following will not be executed
ShowMessage('We do not get this far');
Show full unit code
The program terminates without running the ShowMessage statement. An error dialog is displayed:
Runtime error 4 at 0069FC94