Sign in Join
FPDoc Onlineexperiment

Halt procedure

In unit System

Stop program execution.

Declaration

pascal
procedure Halt(errnum: TExitCode)

Description

Halt stops program execution and returns control to the calling program. The optional argument Errnum specifies an exit value. If omitted, zero is returned.

Note that this skips any try/finally (implicit or explicit) or try/except blocks, thus may result in memory leaks. Finalization sections of units will be executed.

Errors

None.

See also

Example: ex30

pascal
Program Example30;

{ Program to demonstrate the Halt function. }

begin
 Writeln ('Before Halt.');
 Halt (1); { Stop with exit code 1 }
 Writeln ('After Halt doesn''t get executed.');
end.

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.