> On Oct 23, 2017, at 8:55 PM, Mattias Gaertner <nc-gaert...@netcologne.de> 
> wrote:
> 
> program test1;
> 
> {$mode objfpc}{$H+}
> {$ModeSwitch nestedprocvars}
> 
> type
>  TCallback = procedure (a: integer) is nested;
> 
> procedure DoCallback;
>  procedure DoThis(a: integer);
>  begin
>    writeln(a);
>  end;
> var
>  callback: TCallback;
> begin
>  callback := @DoThis;
>  callback(100);
> end;
> 
> begin
>  DoCallback;
> end.
> 
> Keep in mind what Sven wrote. You cannot use "callback" outside of
> DoCallBack, because FPC does not yet support Delphi's "reference to".

Thanks, I never heard of nestedprocvars. Why isn’t that the default? If I have 
a callback I may have it be nested or not so I always want “is nested” on I 
guess.

Regards,
        Ryan Joseph

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to