[Lazarus] const array syntax

Paul Ishenin webpirat at mail.ru
Tue Jan 12 14:59:39 CET 2010


Jürgen Hestermann wrote:
> 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 can't. How compiler will decide whether this is a constant 'auto' or a 
keyword inside the const declaration?
>> I would go for
>>   arr: [1..] of Integer = (1, 2, 3);
Maybe, but this can lead to ocasional errors. What if developer forgot 
to write the paticular value on which program execution depends.

I would use arr[] of Integer as in C. This would also simplify code 
porting :)

Best regards,
Paul Ishenin.





More information about the Lazarus mailing list