StrinList problem again - anybody please ?


2004-04-04 05:14:50 AM
cppbuilder106
Hi !
Could you help me please with a short example, how can I pass StringList
value from a routine ?
In deatils :
I would like to create a "routine" include file, where I manipulate a big
text file, filter lines from it, and then I put back into a StringList. But
I need to pass this value back to the main file. I did this several thimes
with an AnsiString ,but I can not do it with StringList. Can you help me
please ? The code :
//--------------------------------------------------------------------------
-
TStringList __fastcall parse_html_tag(TStringList value, AnsiString data,
AnsiString html_tag_start, AnsiString html_tag_end)
{
int pos1 = 0;
int pos2 = 0;
value = new TStringList();
AnsiString tmp = "";
while (data.Pos(html_tag_start))
{
pos1 = data.Pos(html_tag_start);
pos2 = data.Pos(html_tag_end)+html_tag_end.Length();
tmp = data.SubString(pos1+html_tag_start.Length(),data.Length());
tmp = tmp.SubString(1,tmp.Pos(html_tag_end)-1);
data.Delete(pos1, pos2-pos1);
value->Add(tmp);
}
return value;
}
//--------------------------------------------------------------------------
-
Thanks a lot,
Moore