Author: Tomas Rutkauskas
I'm looking for a component that will build a semicolon delimited list of paths,
like the one Delphi presents you to build the include path, etc.
Answer:
No need for a component, just use straight Object Pascal. Example:
1 2 procedure TForm1.Button1Click(Sender: TObject);
3 var4 sList: TStringList;
5 i, iRes: integer;
6 sTmp: string;
7 begin8 sTmp := '$(DELPHI)\Lib;$(DELPHI)\Bin;$(DELPHI)\Imports;$(DELPHI)\Projects\Bpl';
9 sList := TStringList.Create;
10 try11 iRes := Pos(';', sTmp);
12 while iRes > 0 do13 begin14 sList.Add(Copy(sTmp, 1, iRes - 1));
15 Delete(sTmp, 1, iRes);
16 iRes := Pos(';', sTmp);
17 end;
18 if sTmp <> EmptyStr then19 sList.Add(sTmp);
20 showmessage(sList.Text);
21 sTmp := '';
22 for i := 0 to sList.Count - 1 do23 if i < sList.Count - 1 then24 sTmp := sTmp + sList[i] + ';'
25 else26 sTmp := sTmp + sList[i];
27 showmessage(sTmp);
28 finally29 FreeAndNil(sList);
30 end;
31 end;