[Lazarus] *** GMX Spamverdacht *** Re: FW: Re: more file operation problems

Jürgen Hestermann juergen.hestermann at gmx.de
Thu Dec 15 17:33:52 CET 2011



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.





More information about the Lazarus mailing list