[fpc-pascal] string in fpc

Jonas Maebe jonas.maebe at elis.ugent.be
Sat Feb 11 09:55:07 CET 2006


On 10 Feb 2006, at 20:31, Andrzej Baran wrote:

> I noticed that declaration of variable like:
> a:string[1]; is not valid any more in fpc-2.0.2, so how can I  
> declare a
> variable to get few char string instead of full length

It works here, even if ansistrings are the default ({$h+} or Delphi  
mode activated). The only thing that (logically) doesn't work here is  
"a:ansistring[1]".

Note that 2.02 has a bug whereby reading such length-limited strings  
can cause a buffer overflow (which has been fixed in the mean time).


Jonas



More information about the fpc-pascal mailing list