Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2006-02

TStrings.Assign doesn't copy Delimiter

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Vincent Snijders

Hi,

The program below exits with an error. I would expect the Delimiter to be copied too, when a TStrings is assigned. Is this a bug?

Vincent

{$mode objfpc}{$H+}
uses
   Classes;
var
   s1, s2: TStrings;
begin
   s1 := TStringList.Create;
   s1.Delimiter := ';';
   s2 := TStringList.Create;
   s2.Assign(s1);
   if s1.Delimiters2.Delimiter then
     Halt(1);
   writeln('Success');
   readln;
end.

Reply by email

Geno Roupsky
to Vincent Snijders

Well this is the way borland implemented it from the begining.

Although it makes sense to copy the delimiter too there is a lot of code out there and some may be broken if this is changed.

Geno Roupsky

2006/2/22, Vincent Snijders :

Show quoted text 32 lines
Hi, The program below exits with an error. I would expect the Delimiter to be copied too, when a TStrings is assigned. Is this a bug? Vincent {$mode objfpc}{$H+} uses Classes; var s1, s2: TStrings; begin s1 := TStringList.Create; s1.Delimiter := ';'; s2 := TStringList.Create; s2.Assign(s1); if s1.Delimiters2.Delimiter then Halt(1); writeln('Success'); readln; end. _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email