你可以用break退出while循环.
如何退出if.
Delphi中有一种GOTO吗?
procedure ... begin if .... then begin here the code to execute if (I want to exit = TRUE) then break or GOTO here the code not to execute if has exited end; here the code to execute end;
解决方法
您可以使用例外.
在内部if或循环中调用Abort,并在需要继续的地方捕获EAbort异常
procedure ... begin try if .... then begin (* here the code to execute *) if I_want-to-exit then Abort; (* here the code not to execute if has exited *) end; except on E: EABORT do ; end; (* here the code to execute *) end;