[fpc-pascal] Is there a bug in TStrings.Delimiter handling?

michael.vancanneyt at wisa.be michael.vancanneyt at wisa.be
Mon Nov 21 11:06:08 CET 2011



On Mon, 21 Nov 2011, Graeme Geldenhuys wrote:

> On 2011-11-21 11:17, michael.vancanneyt at w..... wrote:
>>> Where in the Delphi documentation does it mention that?  I couldn't find
>>> any such reference in the Delphi 7 docs, and I thought FPC implements
>>> behaviour based on documented behaviour, not implementation behaviour?
>>
>> Sure. See the 'CommaText' help.
>
> Sure, that is the help for CommaText, not the help for Delimiter or
> DelimitedText. In the latter documentation it makes no mention of SDF
> (System Data Format) format usage - which apparently has the Comma or
> Space character requirement.
>
> DelimitedText docs say:  "individual strings are separated by the
> character specified by the Delimiter property."
>
> I guess this boils down to the interpretation of the Delphi
> documentation then.

In my opinion, the Delphi documentation is quite explicit:

-----------------------------------------------------------------------
When writing DelimitedText, individual strings must be separated using
QuoteChar at both ends, using Delimiter as a separator, or using both these
methods.

Note:	CommaText is the same as the DelimitedText property when Delimiter
is ',' and QuoteChar is '"'.
-----------------------------------------------------------------------

The first paragraph indicate that in fact you should always use " around your
values.

And the last sentence should prompt anyone to go and read the CommaText
docs.

But we're not here to discuss the merits/disadvantages of the Delphi docs :-)

Michael.



More information about the fpc-pascal mailing list