Re: a few questions
- Posted by Irv Mullins <irvm at ellijay.com> Jul 30, 2001
- 383 views
> In EU data base I see no way to perform a 'read next' or 'read previous' > type function. I would like to be able to do this and get the data elements > out in sorted (by key) order. Is this do'able? The are apparently stored in > sorted order since a binary search is done with a db_find. The keys are stored in sorted order with the base. To read them all, loop from 1 ... db_table_size() To select the prev or next record, either keep a counter, or, if you have done a lookup, and want the previous or next record from that point: x = db_find_key(IHaveThisKey) if x > 0 then -- key was found, so prevkey = db_record_key(x-1) nextkey = db_record_key(x+1) nextdata = db_record_data(x+1)... You may want to put some sanity checks on x before you try to retrieve record numbers less than 1 or higher than the size of the table. Regards, Irv