To demonstrate TRon's remark, have a look at this example and see why that is important:
program sep2;
{$mode objfpc}
uses
classes;
var
l:Tstringlist;
i:integer;
s:string = '';
begin
if paramcount > 0 then
begin
for i := 1 to paramcount do
s:=s+paramstr(i);
l:=Tstringlist.create;
try
l.adddelimitedtext(s,'\',false); // first output is true, second output is with false
writeln(l.text);
finally
l.free;
end;
end;
end.
sep2 "this is \" a\ test \with spa\ces
this is
a
test
withspa
ces
Now, if you expect that, it is fine, otherwise you will need much more complex code.
(also experiment with true/false!)
D:\>sep2 "this is \" a\ test \with spa\ces
this
is
a
test
withspa
ces
And experiment with this little change:
s:=s+#32+paramstr(i);// this restores the space
D:\>sep2 "this is \" a\ test \with spa\ces
this is
a
test
with spa
ces
Note true/false makes a big difference here, either include the slash or not.
So make a decision, otherwise you will need to write a parser yourself.
[edit]
This is a riddle with just a couple of solutions...
Find the solution that includes the \ in the quoted string....
Have fun.