Hi
I'm trying to use Free Pascal for a simple problem - passing a function as a parameter to a procedure.
This works fine in Turbo Pascal, but in Free pascal throws up the error:
Wrong number of parameters in call to "<function name>"
In all other respects Free Pascal seems to be a great compiler, but I can't understand how such a basic problem should go undetected.
The following code illustrates what I'm trying to do:
program fred;
type funcparam=function(x:real):real;
function jim(x:real):real;far;
begin
jim:=x
end;
procedure bill(func:funcparam);
begin
writeln(func(3):5:2);
end;
begin
bill(jim);
end.
Can anyone shed any light on this, or tell me the fix. (I know the 'far' is unnecessary in Free Pascal, it's needed for Turbo pascal but it isn't the problem.)