gpt4 book ai didi

inno-setup - 你能在 Inno Setup 中定义一个函数原型(prototype)吗

转载 作者:行者123 更新时间:2023-12-03 11:20:24 25 4
gpt4 key购买 nike

我希望能够为我的 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/

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