Suggest you use either an intermediate array of structs: 
1 struct per table row (usually around 11 visible at most).
During the first loop fill in the structs as you match.
Structs can be tiny: sometimes just a UInt16 to hold your DB record index.
Sort the structs if needed.
Fill in table from the structs maybe using a custom draw callback.
OR
use the built in Tbl... APIs to store record indexes without use of helper
structs.
Much faster than 2 passes and only a little overhead lets you 'decouple' the
table from the DB.

Some of the Palm examples (Date Book, Address Book) do things like this.

Regards
Randy Maxwell
[EMAIL PROTECTED]

-----Original Message-----
From: Oskie [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 13, 2000 7:46 PM
To: Palm Developer Forum
Subject: Searching thru db & displaying in table


Hi!  I have a query function in my app'n, that would search through my
database and display it on a table.  This is how I plan to do it:
- loop through the db, find the records matching the query criteria and
count the number of rows needed for the table
- loop through the db again and display the matching records

But I'm afraid this would take a lot of resources in my palm (I have a lot
of records) and that wouldn't be good. Could anyone provide an alternative
solution?

Any help would be much appreciated.  Thanks in advance!

Oscar



-- 
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/tech/support/forums/

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to