[fpc-pascal] string in fpc

Marco van de Voort marcov at stack.nl
Sat Feb 11 17:40:45 CET 2006


> On Sat, 11 Feb 2006, Marco van de Voort wrote:
> 
> > > 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]".
> > 
> > This also doesn't work (I don't see why not?)
> > 
> > {$mode delphi}
> > 
> > var x : shortstring[4];
> > 
> > begin
> > end.
> 
> Because shortstring is defined as String[255]

Hmm. How do I get real shortstring behaviour in delphi mode then?



More information about the fpc-pascal mailing list