<div dir="auto"><div class="gmail_quote" dir="auto"><div dir="ltr">Am Do., 15. Nov. 2018, 12:40 hat Ryan Joseph <<a href="mailto:ryan@thealchemistguild.com">ryan@thealchemistguild.com</a>> geschrieben:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
> On Nov 15, 2018, at 5:14 PM, Sven Barth via fpc-pascal <<a href="mailto:fpc-pascal@lists.freepascal.org" target="_blank" rel="noreferrer">fpc-pascal@lists.freepascal.org</a>> wrote:<br>
> <br>
> See the notes mentioned here: <a href="http://wiki.freepascal.org/FPC_New_Features_2.6.0#Support_for_nested_procedure_variables" rel="noreferrer noreferrer" target="_blank">http://wiki.freepascal.org/FPC_New_Features_2.6.0#Support_for_nested_procedure_variables</a><br>
> <br>
> Don't know if it is documented as such, but if not, it should be. <br>
> <br>
<br>
Sorry I’m not understanding this. I read we can make the assignment but the part I’m curious about is passing the function pointer out of the nested functions scope. I did some tests and it work in some cases and gave me garbled memory in others. Just wanted to make absolutely certain what’s happening here.<br></blockquote></div><div dir="auto"><br></div><div dir="auto">The linked entry answers your question directly:</div><div dir="auto"><br></div><div dir="auto">"if you assign a nested routine to nested procedure variable and then exit the nested routine's parent stack frame, calling the nested procedure variable will result in undefined bahaviour [sic]." </div><div dir="auto"><br></div><div dir="auto">Regards, </div><div dir="auto">Sven </div><div class="gmail_quote" dir="auto"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"></blockquote></div></div>