[fpc-pascal] Problem passing pointers to "hidden" procedure

andrew.bennett at ns.sympatico.ca andrew.bennett at ns.sympatico.ca
Sat Oct 15 23:21:54 CEST 2011


On Sat, 15 Oct 2011 09:24:36 +0200 "Ludo Brands" 
<ludo.brands at free.fr> wrote

>On Fri, 14 Oct 2011 20:01:47 -0300 <andrew.bennett at ns.sympatico.ca> >wrote

>> When the routine being passed as a parameter is in the top >> level of the unit, "PrPublic", all is well; the expected pointers are >> passed. When an identical routine "PrPrivate" is hidden inside >> the top level routine "Test_it", the expected 2nd pointer appears >> in place of the first and an apparently random pointer appears >> second. >> >> What am I doing wrong? >>  >You can't assign private functions to procedural types. >http://www.freepascal.org/docs-html/ref/refse17.html says "A global >procedure or function address". The delphi 6 help is even more explicit: >"Nested procedures and functions (routines declared within other routines) >cannot be used as procedural values."  >Ludo 

Oops! Silly me. But some kind of complaint from the compiler would
have been helpful!

Andrew Bennett

 



More information about the fpc-pascal mailing list