hi
I have a search algorithm that compares every record in my database
(about 1600 records) against 1 or more numerical criteria. If the
record doesn't match one or more criteria, the record is marked
invalid, the program exits the current block and starts again with the
next record. Each of the items to search for are in a series of nested if
statements e.g. :
if (!invalid)
{
if (recP->price > search.maxPrice)
invalid = true;
if (!invalid)
{
if (recP->qty < search.minQty)
invalid = true;
if (!invalid)
{
e.t.c. e.t.c.
}
}
}
if (invalid)
arrayOfRecIndexes[currentRecord].invalid = true;
arrayOfRecIndexes is then used to display a list of matching records.
the comparisons likely to give the most invalid results are carried
out first in order to minimise searched. The problem is this search is taking almost
15 seconds to
complete. Is this simply due to the large number of records or am I
going about this the wrong way? Could it be the MemHandleLock() and
MemHandleUnlock() for each record that is taking so much time?
any help appreciated.
ahmed
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/