Is there any command/construct like return in C that exits immediately from a function of Inno Setup script code keeping the result code?
I would like something
If k = false then
Begin
Result:=false;
Exit;
End;
Is there any command/construct like return in C that exits immediately from a function of Inno Setup script code keeping the result code?
I would like something
If k = false then
Begin
Result:=false;
Exit;
End;
Your code is correct.
Use the Exit statement to exit a function or a procedure. With the function, set the Result automatic variable, before you call the Exit, to set the return value.
function MyFunction: Boolean;
begin
if not SomeTest then
begin
// cannot do stuff, aborting
Result := False;
Exit;
end;
// do stuff
Result := True;
end;