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

2011-10-21 Thread Marco van de Voort
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)

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

2011-10-21 Thread Jonas Maebe
On 21 Oct 2011, at 08:25, Roberto P. wrote: > 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). Jonas

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

2011-10-20 Thread Roberto P.
2011/10/21 Tomas Hajny > On 20 Oct 11, at 17:43, Andrew Pennebaker wrote: > > > It's inconsistent and ripe for bugs. > > Array indices may start at any ordinal value (including e.g. > characters, values of enumerated types, etc.), not just 0. Only > dynamic arrays always start at 0 because that i

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

2011-10-20 Thread waldo kitty
On 10/20/2011 17:43, Andrew Pennebaker wrote: It's inconsistent and ripe for bugs. funny thing, that... i thought the same thing when looking at the proposals and requests :LOL: ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://list

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

2011-10-20 Thread Tomas Hajny
On 20 Oct 11, at 17:43, Andrew Pennebaker wrote: > It's inconsistent and ripe for bugs. Array indices may start at any ordinal value (including e.g. characters, values of enumerated types, etc.), not just 0. Only dynamic arrays always start at 0 because that is how they have been "imported" fr

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

2011-10-20 Thread Andrew Haines
On 10/20/11 17:43, Andrew Pennebaker wrote: > It's inconsistent and ripe for bugs. > > Cheers, > > Andrew Pennebaker > www.yellosoft.us > > > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepa

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

2011-10-20 Thread Andrew Pennebaker
It's inconsistent and ripe for bugs. Cheers, Andrew Pennebaker www.yellosoft.us ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal