Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you define a function prototype in Inno Setup

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.

like image 413
AnthonyVO Avatar asked Jul 24 '26 22:07

AnthonyVO


1 Answers

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.

like image 61
Martin Prikryl Avatar answered Jul 28 '26 15:07

Martin Prikryl



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!