今天下午我一直在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的帮助页面,但它们没有涵盖这样的内容。谢谢
发布于 2012-05-15 13:00:58
您使用了错误的文档,您的链接指向Sun Workshop Compiler Pascal 4.2。Inno setup使用RemObjects Pascal Script作为脚本语言,这是一种类似于Delphi的Pascal方言,Inno使用的Pascal脚本的官方文档位于here,另外您可以查看Marco Cantù's Essential Pascal。
https://stackoverflow.com/questions/10593924
复制相似问题