Hi,
Hab mal was gebaut. Hab mich bisschen an der
VCL Orientiert aber passt schon
Delphi-Quellcode:
interface
uses ...;
type
TStringlist = class(Classes.TStringlist)
private
FDelText: String;
procedure SetDelimitedText(const Value: String);
public
property DelimitedText: String read FDelText write SetDelimitedText;
end;
implementation
procedure TStringlist.SetDelimitedText(const Value: String);
var P,tmp: PChar;
S: String;
begin
FDelText := Value;
BeginUpdate;
Clear;
P := PChar(Value);
while P^ <> #0 do
begin
tmp := P;
while (P^ >= ' ') and (P^ <> Delimiter) do // >= ist wichtig.. Im Original ists nur >
inc(p);
SetString(S,tmp,P-tmp);
Add(S);
inc(p);
end;
EndUpdate;
end;
// Anwendung
procedure TForm1.Button1Click(Sender: TObject);
var S: TStringlist;
begin
S := TStringlist.Create;
try
S.Delimiter := ';';
S.DelimitedText := 'Ich;schreibe was;hier hin;!!!';
Memo1.Text := S.Text;
finally
S.Free;
end;
end;
Gruß
Neutral General
Michael
"Programmers talk about software development on weekends, vacations, and over meals not because they lack imagination,
but because their imagination reveals worlds that others cannot see."