Sign in Join

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

Mailing lists / fpc-pascal / 2011-10

RE : Problem passing pointers to "hidden" procedure

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

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

Unknown author

On Sat, 15 Oct 2011 09:24:36 +0200 "Ludo Brands"
wrote

On Fri, 14 Oct 2011 20:01:47 -0300 >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

Reply by email