Hi Hans
Mmmm... In such a seemingly simple mechanism, there lurks a couple of "Gotcha"s, here and there.
Did you by any chance, forget what you should remember?!? Look for remember below:
procedure TfeaModelMain.DoEach(const aValue: string; const anIdx: ptrint;
anObj: TObject; aData: pointer);
var ls: string; lid: integer;
begin
if fSecId = -1 then exit;
ls:= LeftWord(aValue);
lid:= IndexText(ls,Sects);
if lid = fSecId then begin
IStringList(aData).Append(aValue); //<- new feature <aData> typecast :o)
fInSection:= true;
end else begin
if fInSection then begin
case lid of
0..2: fInSection:= false; /// remember to adjust selector-values according to 'Sects'
end;
if fInSection then IStringList(aData).Append(aValue); //<- new feature <aData>
end;
end;
end;
those 'selectors' decide, when the 'Section' stops loading, so that you only get 1 section! Otherwise, it stops at list-end.
These 'case-selectors' need to correlate with the 'Sects' array, because 'lid' & 'fSecId' constantly monitors what comes through this little search engine...
Just off the bat, that might be your problem...
Regards Benny