孤独的猫

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

procedure ParseStrToStrings(AStrings:TStrings;S:String;iType:integer;seperator:string);

var

i:integer;

begin

if (iType<0) or (iType>5) then

Exit;

if iType=4 then

begin

AStrings.CommaText :=s;

Exit;

end;

case iType of

0: Seperator :=',';

1: Seperator :=';';

2: Seperator :=' ';

3: Seperator :=chr(VK_TAB);

end;

i:=pos(seperator,s);

while i>0 then

begin

AStrings.Add(Copy(s,0,i-1));

s :=copy(s,i+length(seperator),length(s));

i :=pos(seperator,s);

end;

if s<>' ' then

AStrings.Add(s)

end;

posted on 2008-09-10 18:50  孤独的猫  阅读(182)  评论(0编辑  收藏  举报