[fpc-pascal] Question about functions returning a string

leledumbo leledumbo_cool at yahoo.co.id
Mon Dec 1 04:34:50 CET 2014

> So in general, one should not use managed types in the prototype of an
exported (public) function?

Bingo. At least not until we have properly sharable RTL.

> my thought was that it would be 
possible to pass along these managed types (especially string, as it is 
a pointer internally) to another pascal function (a callback in my case).

You can still pass pointer to its first element as a PChar, treating it
read-only in the caller for safety reason (though it's possible to make it
writable as well, but the safety burden is propagated to the caller).

View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Question-about-functions-returning-a-string-tp5720544p5720552.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.

More information about the fpc-pascal mailing list