versuchs mal damit
Delphi-Quellcode:
// String in TStrings umwandeln
procedure readcommand(line:string; Delimiter:array of char; Commandlist:TStrings);
var
Pos1,Pos2:Integer;
len:integer;
dcount,delim:Integer;
Help:string;
begin
if Commandlist = NIL then
Commandlist := TStrings.Create;
Commandlist.Clear;
dcount:=length(Delimiter);
line:=trim(line);
IF dcount>0 then
begin
pos2:=0;
len:=Length(line);
delim:=0;
line:=line + Delimiter[dcount-1];
while Pos2 < Len do
begin
pos1:=pos2;
Pos2:=PosEx(Delimiter[delim],line,pos1+1);
if pos2=0 then pos2:=len+1;
Help:=AnsiMidStr(line,Pos1+1,Pos2-Pos1-1);
Commandlist.Add(Help);
if delim < dcount-1 then inc(delim);
end;
end
else
Commandlist.Add(line);
end;
das kannst du debuggen und dir den besten Teil raussuchen!
gruß
Jörg