[fpc-devel] TFieldDef.Size vs TField.Size

michael.vancanneyt at wisa.be michael.vancanneyt at wisa.be
Thu Feb 24 09:49:51 CET 2011

On Thu, 24 Feb 2011, Martin Schreiber wrote:

> On Thursday 24 February 2011 08:02:20 LacaK wrote:
>> So also here we can see, that FieldDef.Size is expected to be number of
>> characters not bytes.
>> So IMHO logical conclusion will be say, that TFieldDef.Size for string
>> fields has same menaing as Field.Size, so it is number of characters
>> (so documentation is wrong in this case ... also fast test in Delphi
>> shows, that FieldDef.Size=Field.Size=number of characters)
> Agreed. In MSEgui tmsestringfield.size is the maximum allowed character count
> for the field. 0 = no limit. tmsebufdataset stores string data as
> UnicodeString instead to use a fixed record layout.

But here you implicitly assume that you have a fixed number of bytes per
character. You should always be explicit about such things, since this is a
non-trivial assumption.


More information about the fpc-devel mailing list