RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
SysUtils.Abort Function

Raises a silent exception.

Pascal
procedure Abort;
C++
Abort();

Use Abort to escape from an execution path without reporting an error. 

Abort raises a special "silent exception" (EAbort), which operates like any other exception, but does not display an error message to the end user. Abort redirects execution to the end of the last exception block.  

Delphi Examples: 

 

{
This example checks for a valid entry in a TDBEdit control
and calls the Abort procedure if the control is empty; Abort
cancels the post before it happens.
}
procedure TForm1.ClientDataSet1BeforePost(DataSet: TDataSet);
begin
  if DBEdit1.Text = '' then
    Abort;
  DataSet.Fields[2].AsString := DBEdit1.Text;
end;

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!