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. In Delphi, the Exit procedure immediately passes control away from the current procedure. If the current procedure is the main program, Exit causes the program to terminate.Exit will cause the calling procedure to continue with the statement after the point at which the procedure was called.Note: Exit passes control away from the current procedure, not merely the current block. But Exit does not violate the flow of control dictated by a try..finally construct; if Exit is called inside the try clause, the finally clause is still executed.
exit中断某个过程 abort中断某个循环
例子: ....................... var i : integer; begin for i :=0 to 10 then begin if i=1 then exit/abort;//exit将直接跳出该过程 abort中断循环但下面的过程继续执行 end; ................. end;
In Delphi, the Exit procedure immediately passes control away from the current procedure. If the current procedure is the main program, Exit causes the program to terminate.Exit will cause the calling procedure to continue with the statement after the point at which the procedure was called.Note: Exit passes control away from the current procedure, not merely the current block. But Exit does not violate the flow of control dictated by a try..finally construct; if Exit is called inside the try clause, the finally clause is still executed.
abort中断某个循环
.......................
var
i : integer;
begin
for i :=0 to 10 then
begin
if i=1 then
exit/abort;//exit将直接跳出该过程 abort中断循环但下面的过程继续执行
end;
.................
end;