[Lazarus] FW: Re: more file operation problems
Chris Kelling
kellingc at cox.net
Thu Dec 15 15:14:01 CET 2011
On Thu, Dec 15, 2011 at 7:39 AM, Sergei Gorelkin wrote:
> 15.12.2011 16:10, Bart пишет:
>> On 12/12/11, Chris Kelling<kellingc at cox.net> wrote:
>>
>> As I posted in the other thread
>>
>> (http://lists.lazarus.freepascal.org/pipermail/lazarus/2011-December/069100.html)
>> I think the problem is in the definition of your record type
>> stockitem.
>> It uses strings. Explicitely change that to ShortString.
>>
> Exactly so. Managed types cannot be used in typed files. This is
> rejected by Delphi, and by FPC > 2.4.4 as well. See
> http://bugs.freepascal.org/view.php?id=15447
>
> Sergei
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).
Thanks for helping me work through a stupid rookie mistake.
-Chris
More information about the Lazarus
mailing list