Re: [fpc-pascal] Question about functions returning a string
On 11/29/2014 02:46 PM, Sven Barth wrote: In general managed types (which a (Ansi)String is) are passed as parameters. That is very interesting knowledge. Thanks! So in general, one should not use managed types in the prototype of an exported (public) function? While I do know that the other language can't do anything useful with it, 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). -- Ewald ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Question about functions returning a string
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. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal