gpt4 book ai didi

delphi - 从 Delphi 中的 "if"退出

转载 作者:行者123 更新时间:2023-12-03 14:55:34 35 4
gpt4 key购买 nike

您可以使用 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/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com