Hi Ralf, Thank you for the comments. Two derived questions then, if I could: 1. It seems that the offsets function returns information about the bytes, only, but not characters? How to handle UNICDOE then? For example, the description of the 3rd integer of the return value of offsets function: "The byte offset of the matching term within the column.". 2. When manually extracting the snippets from a large string (thousands of characters), what's the most efficient way? especially that I need to also insert the <b></b> around the matching keywords? Do you have a library that make these kind of things easier? You know, you have a bunch of libraries ;) On Tue, Mar 16, 2010 at 7:28 PM, Delphi Inspiration <delphi@xxxxxxxx> wrote: > At 11:21 16.03.2010, Edwin Yip wrote: > > >It seems the snippet function in DiSqlite only returns the first > occurrence of the matching string, > > Yes, this is the expected behaviour. > > >how to get all? I am asking this because I want to implement something > like search result preview, for example, when searching a document for a > string, I want to use a TListView control to list all matching snippets, so > that the cursor will go to the corresponding matching place when the user > click anyone the list items. > > > >The only approach I can think of as of now is that, to use the offsets > information to extract matching strings from the original text. > > I can not think of another approach either, but this one should certainly > do the trick. Especially so since the snippets() function does not return > the position of the snippet within the text. > > Ralf > > _______________________________________________ > Delphi Inspiration mailing list > yunqa@xxxxxxxxxxxxx > //www.freelists.org/list/yunqa > > > > -- Best Regards, Edwin Yip Mind Mapping is as Effortless as Typing http://www.InnovationGear.com