OK, thanks. I just want to know why such a thing cannot be detected at compile time. So, a good typing practice is the solution, right? Like this:
program test; type TArrayRange = 1..3; TArray = array[TArrayRange] of Integer; var a: TArray; i: TArrayRange; begin for i := 1 to 4 do a[i] := i; end. -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Range-checking-in-a-for-loop-tp3235085p3235405.html Sent from the Free Pascal - General mailing list archive at Nabble.com. _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal