[fpc-devel] Should TAutoIncField be read only?

Luiz Americo Pereira Camara luizmed at oi.com.br
Wed May 19 05:32:55 CEST 2010


Until a few moments ago i would say yes because it seems logical and fpc 
raises an exception when trying to set the value programatically.

But while investigating why TAutoIncField.ReadOnly always returns false, 
i found that, regardless of FReadOnly being set to true in the 
constructor, this value is overriden in TFieldDef.CreateField throung 
Attributes.faReadOnly flag.

So i tested in Delphi (TClientDatset and TDbf) and found that 
TAutoIncField.ReadOnly is false (like fpc).

So what should fpc do:
- Follow delphi behavior and let TAutoIncField.ReadOnly return False?
- Fix TAutoIncField.ReadOnly to return True?

Luiz







More information about the fpc-devel mailing list