[fpc-pascal]About ansistrings.

Florian Klaempfl Florian.Klaempfl at gmx.de
Sun Dec 31 13:27:53 CET 2000


At 01:40 31.12.00 +0200, you wrote:

>Hi. I'm doing some stuff in which i declare a record-type which
>contains an ansistring. When i try to allocate a variable of that type, i
>get a General Protection Fault. Here's the source code :
>
>---||cut here||---------------------
>type TStuff=record
>             s:ansiestring;
>            end;
>      Pstuff=^Tstuff;
>var stuff:array[1..10] of Pstuff;
>     idx:word;
>begin
>  idx:=1;
>  new(stuff[idx]);
>end.
>---||stop cutting||-----------------
>
>Under Go32 it seems to work, but it crashes under Win32 & Linux.
>
>I've noticed that if i replace "new(stuff[idx])" with "new(stuff[1])" it
>works. And Delphi doesn't seem to have any problem with any of the 2 calls
>to new().
>
>Is there any obvious solution for this ?


Which compiler version do you use? At least with 1.0.2 under linux
I can't reproduce it with the program you provided.






More information about the fpc-pascal mailing list