[fpc-devel]array dimensions bug?
Jonas Maebe
jonas at zeus.rug.ac.be
Tue Nov 6 14:33:50 CET 2001
On dinsdag, november 6, 2001, at 02:30 , Peter Vreman wrote:
>> Always use low and high. They are evaluated at compile time if
>> possible,
>> so you will not lose any speed and you will always get the correct
>> results.
>
> open arrays start always with 0. But using low() and high() is the
> recommended way
I know, but you shouldn't say this, because people will start using 0
(even though low(a) will be replaced by "0" at compile time and as such
is just as fast as using "0") and then start reporting bugs if for some
reason this changes somewhere in the future for a certain kind of
array :)
>> Shouldn't this be rejected? Passing an integer as an "array of
>> integer"??
>
> No, this is also support by delphi/tp7. It is passed as 'array[0..0] of
> integer'
In that case, there is no problem :)
Jonas
More information about the fpc-devel
mailing list