gpt4 book ai didi

inno-setup - 从循环中退出会退出函数

转载 作者:行者123 更新时间:2023-12-03 09:36:00 26 4
gpt4 key购买 nike

今天下午我一直在 Inno Setup 中编码,我读了一些 Pascal documentation其中说 exit用于退出循环。我尝试在我的代码中使用它,但它退出了该函数。例如在这个函数中,消息框永远不会显示:

function NextButtonClick(CurPageID: Integer): Boolean;
var i: Integer;
begin
Result := True;

for i := 0 to 4 do
begin
exit
end;

MsgBox('test',mbInformation,MB_OK);
end;

我做了更多的谷歌搜索,Pascal 也有 break关键字所以我使用了它并且它可以正常工作。是 exit真的应该用来退出函数吗?我记得今天下午读到 Pascal 没有相当于 C 风格的 return 语句。

我真的需要一些关于 Inno Setup 正在使用的 Pascal 版本的好的文档。我已经阅读了 Inno 帮助页面,但它们没有涵盖这样的内容。谢谢

最佳答案

您使用了错误的文档,您的链接指的是 Sun Workshop Compiler Pascal 4.2 . Inno setup 用作脚本语言 RemObjects Pascal Script 这是一种类似 Delphi 的 Pascal 方言,Inno 使用的 Pascal Sripting 的官方文档位于 here , 另外您可以查看 Marco Cantù's
Essential Pascal
.

关于inno-setup - 从循环中退出会退出函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10593924/

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