News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

BinSearch

Started by Danesh, January 20, 2007, 05:07:15 AM

Previous topic - Next topic

Danesh

Hi all,

I need a binary search function which supports searching in both strings and DWORD number arrays. Actually, I have my own binary search functions, but I prefer to use BinSearch function in MASM32 Lib but I am not sure if supports searching withing a DWORD array or only string arrays. Besides, some input parameters like

4. lpSubStr The address of the sub string to search for.

5. lnSubSt The length of the sub string

are unclear to me. I could not find any sample code in example codes. Have you any sample code or tip to help me how to use it for both strings and DWORDs arrays?

Thanks,

D.

hutch--

Danesh,

The BinSearch algo is designed to search any sequence of data you point at it. It uses a length to test for and does not depend on there being an ascii zero as a terminator. Now with a DWORD array, you would probably do an array scan looking at each value to search for any partiular value and this will be faster than a BYTE level scanner like BinSearch.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php