[fpc-pascal] TStringList Bug?

Jeremy Cowgar jeremy at cowgar.com
Tue Sep 26 17:21:00 CEST 2006


Below is a simple program that I *think* is working wrong. I am new  
to Pascal, so I may very well be doing something wrong.

Can anyone comment?

Jeremy

--------------------

program stringlistbug;

uses Classes;

var
	SL : TStringList;
begin
	SL := TStringList.Create;
	SL.Delimiter := '|';
	SL.DelimitedText := 'Hello World|How are you doing?';
	
	writeln('One ="', SL[0], '"');
	writeln('Two ="', SL[1], '"');
end.

(*
Output:
     $ ./stringlistbug
     One ="Hello"
     Two ="World"

Shouldn't it be:
     $ ./stringlistbug
     One = "Hello World"
     Two = "How are you doing?"
*)



More information about the fpc-pascal mailing list