[Lazarus] *** GMX Spamverdacht *** Re: FW: Re: more file operation problems
Sven Barth
pascaldragon at googlemail.com
Fri Dec 16 10:47:46 CET 2011
Am 15.12.2011 17:33, schrieb Jürgen Hestermann:
>
>
> Chris Kelling schrieb:
>> It is confirmed - I forgot about ANSISTRING being a pointer type, and
>> when I was writing the record out it wrote the address, not the data.
>> Of course, when I read it back in, the address was not valid and this
>> caused the error (derefrencing the non-existent pointer).
>
> I often read that users don't need to bother about implementation
> details of certain things (strings or dynamic array types or ...).
> This clearly shows how important such informations are and that generic
> types are pitfalls.
> You never realy know what you get.
> If you would have used AnsiString instead of the generic String you
> would have got an error
> and so would have been reminded that your assumptions (AnsiStrings) are
> not valid.
With 2.6 and newer you'll also get an error if you use "String" and the
record's unit is compiled in long string mode.
Regards,
Sven
More information about the Lazarus
mailing list