DelphiBasics
Abort
Procedure
Aborts the current processing with a silent exception SysUtils unit
 procedure Abort ;
Description
The Abort procedure stops the current processing and exits to the last exception block. In doing so, no end user message is produced - the abort is silent.
Related commands
Break Forces a jump out of a single loop
Continue Forces a jump to the next iteration of a loop
Goto Forces a jump to a label, regardless of nesting
Halt Terminates the program with an optional dialog
RunError Terminates the program with an error dialog
 Author links

 Download this web site as a Windows program.





 
Example code : Aborting from a try block
begin
  // Enter a try block
  Try
    ShowMessage('Before abort');
    Abort;
    ShowMessage('After abort');
  Except
    On E : Exception do ShowMessage(E.Message + ' exception occured');
  end;
  ShowMessage('After try');
end;
Show full unit code
   Before abort
   Operation aborted exception occured
   After try
 
Delphi Programming Neil Moffatt 2002 - 2020. All rights reserved.  |  Home Page