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
BreakForces a jump out of a single loop
ContinueForces a jump to the next iteration of a loop
GotoForces a jump to a label, regardless of nesting
HaltTerminates the program with an optional dialog
RunErrorTerminates the program with an error dialog
 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 . All rights reserved.  |  Home Page