Inno Setup "return" 类似于代码中的 command/construct

Inno Setup "return" like command/construct in Code

C 中是否有像 return 这样的 command/construct 可以立即从 Inno Setup 脚本代码的函数中退出并保持结果代码?

我想要一些东西

If k = false then
Begin
    Result:=false;
    Exit;
End;

您的代码是正确的。

使用 Exit statement 退出 functionprocedure。使用function,设置Result自动变量,在调用Exit之前,设置return值。

function MyFunction: Boolean;
begin
  if not SomeTest then
  begin
    { cannot do stuff, aborting }
    Result := False;
    Exit;
  end;

  { do stuff }

  Result := True;
end;