Previous: 4.67.2.36. GetMem procedure To the Table of Contents Next: 4.67.2.38. Hi function
4.67.2.36. GetMem procedure Table of Contents 4.67.2.38. Hi function

- 4.67.2.37. -
Table of Contents
4. Standard Units
4.67. System - Built-in routines
4.67.2. System Unit Procedures and Functions
4.67.2.37. Halt procedure


4.67.2.37. 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: 4.67.2.36. GetMem procedure To the Table of Contents Next: 4.67.2.38. Hi function
4.67.2.36. GetMem procedure Table of Contents 4.67.2.38. Hi function

- 4.67.2.37. -