[Lazarus] const array syntax

Jürgen Hestermann juergen.hestermann at gmx.de
Tue Jan 12 14:10:14 CET 2010


>>> IDECommandStrs: array[0..*] of TIdentMapEntry = (
>>> IDECommandStrs: array[0..auto] of TIdentMapEntry = (
>>> IDECommandStrs: array[0..end] of TIdentMapEntry = (
>> I would vote for "auto".
> I wont, since the following would fail:
> const
>   auto = 10;
>   arr: [1..auto] of Integer = (1, 2, 3);

That's an issue, yes. Although, in this case the constant "auto" could be independend from the keyword "auto". So it would not fail. Instead constant and array size would not be related in any way (although it appears like that). 
 
> I would go for
>   arr: [1..] of Integer = (1, 2, 3);

Would be as good as any other. To me it makes sense too.





More information about the Lazarus mailing list