Topic: Passing function as parameter to another function
I am trying to pass a function reference to another function. Any thoughts on how to achieve this ?
function add(a, b : integer) : integer;
begin
Result := a + b;
end;
function sub(a, b : integer) : integer;
begin
Result := a - b;
end;
function mul(a, b : integer) : integer;
begin
Result := a * b;
end;
function action(a, b : integer; f : function) : integer;
begin
Result := f(a,b);
end;