Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2011-01

Nested register error for procedure passing address

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Andrew Brunner
procedure Something(Param1...);
var
  my:TMyData;
  procedure Testing; inline; // or whatever
  begin
    my.test:=0;
  end;
begin
  MyAPI.DoeSomething(Param1,@Testing);
end;

I want to be able to pass Testing as a variable so the callback can occur but realize that FPC did not like nested proc. Is there a directive to resolve this?

Reply by email

Max Vlasov
to Andrew Brunner
Andrew Brunner wrote 7 lines
I did read this however, I don't have the option of rewriting all the other implements to my api to declare as nested... http://wiki.freepascal.org/FPC_New_Features_Trunk#Support_for_nested_procedure_variables

Andrew, don't know whether it will help or not, but I did a nested procs test with fpc 2.5.1, you can read the post here:

It seems like adding "is nested" is required in this case so there is no way to do this only with a define. But I may be wrong

Max Vlasov

Reply by email