On 02 Apr 2011, at 19:36, Jürgen Hestermann wrote:
> Jonas Maebe schrieb:
> > If you don't want the compiler to interfere with anything you do, do not
> > use automated types such as ansistring, unicodestring, dynamic array and
> > COM-style interfaces. The whole point of these types is that th
Jonas Maebe schrieb:
> If you don't want the compiler to interfere with anything you do, do
not use automated types such as ansistring, unicodestring, dynamic array
and COM-style interfaces. The whole point of these types is that the
compiler will do lots of stuff behind your back, because with
DaWorm schrieb:
> IMO, a dynamic array should never be part of a structure that is
> passed to BlockWrite in the first place. Not that I use many dynamic
> arrays in the first place, but to me they pass over the border between
> simple data types (that are fine for BlockWrite) and managed data
>
On 02 Apr 2011, at 18:19, Jürgen Hestermann wrote:
> >> I would never expect an assignmet to nil changing anything else than just
> >> the value of the pointer. And for (all?) other pointers this expectation
> >> is valid.
> > That expectation is not valid for any reference counted type (be it
IMO, a dynamic array should never be part of a structure that is
passed to BlockWrite in the first place. Not that I use many dynamic
arrays in the first place, but to me they pass over the border between
simple data types (that are fine for BlockWrite) and managed data
types (that have quite a lo
>> I would never expect an assignmet to nil changing anything else than
just the value of the pointer. And for (all?) other pointers this
expectation is valid.
> That expectation is not valid for any reference counted type (be it a
dynamic array, ansistring, unicodestring, COM-style interfaces).
On 01 Apr 2011, at 18:44, Jürgen Hestermann wrote:
> Jonas Maebe schrieb:
> >> If you Blockwrite a dynamic array pointer to file (i.e. because it is part
> >> of a large record) and read it back later with Blockread then the pointer
> >> value is invalid of course. BUT, if you now try to set it
Jonas Maebe schrieb:
>> If you Blockwrite a dynamic array pointer to file (i.e. because it
is part of a large record) and read it back later with Blockread then
the pointer value is invalid of course. BUT, if you now try to set it to
nil as in
>> DynArray := nil;
>> then Free Pascal seems to f
On 01 Apr 2011, at 18:04, Jürgen Hestermann wrote:
> If you Blockwrite a dynamic array pointer to file (i.e. because it is part of
> a large record) and read it back later with Blockread then the pointer value
> is invalid of course. BUT, if you now try to set it to nil as in
>
> DynArray := n
I just wanted to post a warning for everybody who wants to
(block)write/read dynamic arrays to/from file. All the documentation
about dynamic arrays I found only told me what I *can* do with them but
none said what I can *not* do. And there was no detailed information
about the internal works.
10 matches
Mail list logo