我希望能够为我的 Inno Setup 项目构建我的代码,但我不得不移动代码,因为除非首先定义它,否则您无法调用函数。
有没有办法在顶部声明一个原型(prototype),这样我就不会收到“未知标识符”错误,这样我就可以在逻辑 block 中构建我的代码。
最佳答案
在 Pascal(包括 Inno Setup 中使用的 Pascal 脚本)中,您可以使用 forward
定义函数原型(prototype)(也称为前向声明)。关键词:
procedure ProcA(ParamA: Integer); forward;
procedure ProcB;
begin
ProcA(1);
end;
procedure ProcA(ParamA: Integer);
begin
{ some code }
end;
见 Forward declared functions .
关于inno-setup - 你能在 Inno Setup 中定义一个函数原型(prototype)吗,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30073545/