Quick string search methods?
I've been searching around hoping to find a progressive searching method, but with no luck.
What I am interested in is if there is a more progressive search method then a For Next loop?
For example, lets say I listed all the files on my C drive. To search for a file I do a For Next loop through the list and compare my filename to the data in the list. And that is ok if you want just that one pass.
But what happens if I have to search for a 100 or more file names? The number of passes becomes 100 * ListCount and that gets pretty slow.
Anyone have or heard of any other (faster) methodologies?
Re: Quick string search methods?
What if all the fileNames are loaded into a ListBox, and you use the SendMessage API with the FINDSTRINGEXACT param:
SendMessage(List1.hwnd, LB_FINDSTRINGEXACT, 0&, ByVal sFind) - that would be quicker than a For Next.
Re: Quick string search methods?
Could that be used with the ListView? Because, ListBox is limited to just over 32.000 items which is not sufficient in my case.
Re: Quick string search methods?
Probably.
I did a test with a ListBox containing 32,000 items, and searched for 33 items.
The For Next took approx 3 Seconds, whereas the SendMessage took less than .5 second :)
Re: Quick string search methods?
I will test it with a ListView and post the results. Thanks.
If anyone else has other suggestions feel free to post them :)