您可以使用 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;
最佳答案
喜欢Piskvor mentioned
,使用嵌套的if语句:
procedure Something;
begin
if IWantToEnterHere then
begin
// here the code to execute
if not IWantToExit then
// here the code not to execute if has exited
end;
// here the code to execute
end;
关于delphi - 从 Delphi 中的 "if"退出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11685841/