Re: [fpc-pascal] which "managed" result types require extra work?

2016-06-28 Thread Michael Van Canneyt
On Tue, 28 Jun 2016, Jürgen Hestermann wrote: Am 2016-06-28 um 01:13 schrieb David Emerson: The source of my confusion -- and I suspect that of many others -- is that I always assumed a function result was treated like a local variable within the function, rather than a parameter to the

Re: [fpc-pascal] which "managed" result types require extra work?

2016-06-28 Thread Jürgen Hestermann
Am 2016-06-28 um 01:13 schrieb David Emerson: > The source of my confusion -- and I suspect that of many others -- is that I always assumed a function result was treated like a local variable within the function, rather than a parameter to the function. > Since managed types are automatically

Re: [fpc-pascal] which "managed" result types require extra work?

2016-06-27 Thread David Emerson
On 06/26/2016 10:51 PM, Jonas Maebe wrote: > PS: there is an intrinsic that can help you in this process: the > "default" intrinsic. Default(TSomeType) returns an instance of a > particular type completely initialised to "empty" (0 for ordinal and > floating point types, empty for strings, nil

Re: [fpc-pascal] which "managed" result types require extra work?

2016-06-26 Thread Jonas Maebe
David Emerson wrote: > Which types do we need to initialize to null/nil/zero/'' when they are a > function result? Results of all types (managed or not) need to be set to "empty" if you want them to return an "empty" result. > I understand COM-style interfaces are also managed types, do they

Re: [fpc-pascal] which "managed" result types require extra work?

2016-06-26 Thread David Emerson
Addendum - what about a return value which is a class that implements an interface? ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] which "managed" result types require extra work?

2016-06-26 Thread Dimitrios Chr. Ioannidis
On 27/6/2016 3:55 πμ, David Emerson wrote: Okay, making a new thread here, to ask one question: Which types do we need to initialize to null/nil/zero/'' when they are a function result? - dynamic arrays - ansistring - unicodestring - string, with {$H+} (but not string[length]) - records

[fpc-pascal] which "managed" result types require extra work?

2016-06-26 Thread David Emerson
Okay, making a new thread here, to ask one question: Which types do we need to initialize to null/nil/zero/'' when they are a function result? - dynamic arrays - ansistring - unicodestring - string, with {$H+} (but not string[length]) - records containing any of them - anything else??? I