function SubStrings(S:string):TStringList;
var
i:Integer;
TempList:TStringList;
TempString:string;
begin
TempString:='';
TempList:=TStringList.Create;
for i:=1 to Length(S) do
begin
if S<>' ' then
TempString:=TempString+S
else
begin
if S[i-1]<>' ' then
begin
TempList.Add(TempString);
TempString:='';
end;
end;
var i: integer;
st1, st : string;
begin
i := pos(' ', St)
while i<> 0 do begin
st1:= copy(st, 1, i-1);
st := copy(st, i+1, length(s-1));
listbox1.items.add(st1);
i := pos(' ', st);
end;