Feature Pointers in Inno Setup

Are function pointers supported in Inno Setup? I can not find anything in the documentation. I know that Delphi / Pascal supports them, and since the Inno Setup scripting mechanism is based on it, I hope it is supported.

+3
source share
1 answer

I just did a little test and function pointers really work. The following section [Code]compiles and works fine:

type
  TStrProc =  procedure (const AStr: String);

procedure Call(const AProc: TStrProc; const AStr: String);
begin
  AProc(AStr);
end;

procedure ShowStr(const AStr: String);
begin
  MsgBox(AStr, mbInformation, MB_OK);
end;

function InitializeSetup(): Boolean;
begin
  Call(@ShowStr, 'Hello World!');
end;

BTW: Inno Setup uses the Pascal Script engine from RemObjects . Perhaps you can find more information there.

+7
source

All Articles