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
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
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
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
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
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
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