[fpc-pascal] Are there any drawbacks to "reference to"?
genericptr at gmail.com
Mon Jun 20 15:46:22 CEST 2022
> On Jun 20, 2022, at 8:39 PM, Michael Van Canneyt via fpc-pascal <fpc-pascal at lists.freepascal.org> wrote:
> It allows you to run callbacks without having to declare variables globally:
> Function DoSomething : String;
> L : TStringList;
> SomeCallBack(procedure(s : string)
> With a regular procedure or procedure of object, you'd need to define L
> outside of DoSomething.
I think you could use “is nested” and it would work also but see my other email with my example of a plain procedure which seems to capture for some reason.
More information about the fpc-pascal