Resuelto!
Gracias al duilioisola ese tambien funciona!
Pero este es mas facil:
function MySplit
(source
: string; delimiter
: string): TStringList
;
var i
: integer;
s
: string;
arrString
: TStringList
;
begin
arrString
:= TStringList
.Create;
s
:= '';
i
:= 1;
repeat
begin
if Copy(source
,i
,Length(delimiter
)) <> delimiter
then
begin
s
:= s
+ Copy(source
,i
,1);
i
:= i
+ 1;
end
else
begin
arrString
.Add(s
);
s
:= '';
i
:= i
+ Length(delimiter
);
end;
end
until i >
Length(source
);
if s <>
'' then arrString
.Add(s
);
result
:= arrString
;
end;
Código Delphi
[-]var
arrWaypoint: TStringList;
sList,Waypoint,sMode: string;
posX,posY,posZ: string;
begin
Waypoint := "Ground (1000 1450 7)";
arrWaypoint := MySplit(Waypoint," ");
sMode:= arrWaypoint.Strings[0];
arrWaypoint := MySplit(Waypoint, "(");
arrWaypoint := MySplit(arrWaypoint.Strings[1], ")");
sList := arrWaypoint.Strings[0];
arrWaypoint := MySplit(sList , " ");
posX := arrWaypoint.Strings[0];
posY := arrWaypoint.Strings[1];
posZ := arrWaypoint.Strings[2];
end;