[Lazarus] TStringList : how should it behave on Delimiter = ' ' ?

Michael Van Canneyt michael at freepascal.org
Thu Sep 9 00:45:29 CEST 2010



On Wed, 8 Sep 2010, Hans-Peter Diettrich wrote:

> Lukasz Sokol schrieb:
>
>> I know this is possibly a corner case, when Delimiter = ' ';  but
>> there seems something wrong with the logic in SetDelimitedText... ?
>
> That was my opinion as well, when I had a look at the code some time ago. 
> Either we copy the Delphi code, for compatibility, or we provide our own 
> exact (and meaningful) definition of the behaviour.

The Delphi compatible behaviour must be followed, and is currently implemented.
Delphi and FPC give the same output with the testdata provided. 
Thus, no change is required.

For a good understanding: TStrings is not a substitute for a CSV kind 
of format. Any attempt at using it for that is doomed to fail. 
Use a proper CSV format handling class if you need CSV. 
For example, the sdfdataset unit delivered with FPC contains one such class.

Michael.




More information about the Lazarus mailing list