Playing with a dbf datastore for TvPlanit I came across this issue:
All the examples for creation of dbf files show how FieldDefs are created at run-time code. See for example
http://wiki.freepascal.org/Lazarus_Tdbf_Tutorial#Code_example:_creating_a_table.2FDBF_file.
But TDbf is a component in the Lazarus component palette and has a property FieldDefs with property editor in the Object Inspector. Therefore, it should be possible to add the fielddefs at designtime. However, when the program is run and the table is opened after creation then an error "Invalid dbf file: Invalid field definition" is reported.
Please see attached demo. Button "FieldDefs by code" follows the wiki example and creates the fields at runtime - no issues here. But button "FieldDefs from OI" creates the FieldDefs at design time in the Object Inspector and crashes as described.
Am I missing something?