Previous: GetMem procedure To the Table of Content Next: Hi function

- 4.62.2.37 -
Standard Units
System Unit
System Unit Procedures and Functions

Halt procedure

Targets: MS-DOS, OS/2, Win32

System Unit

Stops program execution and returns to the operating system.

Declaration:
procedure Halt [ ( Exitcode: Word ) ];
where:
Exitcode is an optional expression that specifies the exit code of your program.

Remarks:
The exit code can be retrieved in DOS by using ErrorLevel in a batch file. If the program does not return to DOS, use DosExitCode to determine the exit code. For more information about ErrorLevel consult your DOS reference manual.

Example:
{$ifndef __CON__}
  This program must be compiled as console application only
{$endif}
begin
  if ParamCount <> 1 then begin
    WriteLn('Error: No parameters passed.');
    Halt(1);
  end;
   ...
end.



Previous: GetMem procedure To the Table of Content Next: Hi function
GetMem procedure Table of Content Hi function

- 4.62.2.37 -