Exit

From Delphi Pascal wiki
Jump to navigation Jump to search

Exits immediately from the current block.

Declaration
procedure Exit;
Target
Windows, Real, Protected
Remarks
If the current block is the main program, Exit causes the program to terminate.
See Also
Halt


Sample Code

{Exit.PAS}
{Sample code for the Exit procedure.}

{ For Windows: }
{ uses WinCrt; }

uses Crt;
procedure WasteTime;
begin
  repeat
    if KeyPressed then Exit;
    Write('Xx');
  until False;
end;
begin
  WasteTime;
end.