Can you define a function prototype in Inno Setup

大城市里の小女人 提交于 2020-01-02 08:11:55

问题


I would like to be able to structure my code for my Inno Setup project but I am forced to move code around because you can't call a function unless it is defined first.

Is there a way to declare a prototype at the top so that I don't get the "Unknown identifier" error and so that I can structure my code in logical blocks.


回答1:


In Pascal (including a Pascal Script used in Inno Setup), you can define a function prototype (aka forward declaration) using a forward keyword:

procedure ProcA(ParamA: Integer); forward;

procedure ProcB;
begin
  ProcA(1);
end;

procedure ProcA(ParamA: Integer);
begin
  { some code }
end;

See Forward declared functions.



来源:https://stackoverflow.com/questions/30073545/can-you-define-a-function-prototype-in-inno-setup

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!