[fpc-pascal] string in fpc

Marco van de Voort marcov at stack.nl
Sat Feb 11 15:19:29 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]".

This also doesn't work (I don't see why not?)

{$mode delphi}

var x : shortstring[4];


[Snail] </home/marcov/testing> fpc testshort
Free Pascal Compiler version 2.1.1 [2006/02/10] for i386
Copyright (c) 1993-2005 by Florian Klaempfl
Target OS: FreeBSD/ELF for i386
Compiling testshort.pp
testshort.pp(5,23) Error: Error in type definition
testshort.pp(8,4) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
Error: /home/marcov/bin/ppc386 returned an error exitcode (normal if you did
not specify a source file to be compiled)
[Snail] </home/marcov/testing>

More information about the fpc-pascal mailing list