[fpc-pascal] Why do string indices start at 1, but array indices start at 0?

Marco van de Voort marcov at stack.nl
Fri Oct 21 12:19:31 CEST 2011

In our previous episode, Jonas Maebe said:
> > During compilation, by statically checking the indices used to access the
> > string, the compiler could fire a warning (or error?) if a  string[0] is
> > found.
> The compiler already does that (except for shortstrings, where string[0] is valid).

Isn't the warning mode dependent? Delphi warns, or at least it did in older

More information about the fpc-pascal mailing list