Re: a few questions

new topic     » goto parent     » topic index » view thread      » older message » newer message

On Monday 30 July 2001 09:22, George Walters wrote:
>
> Irv, If I have a particular key  'abc' and it's record and I want the next
> record (in sorted order) it will not necessarily be db_record_key(x+1) ,
> the next record's key. The records are not in sorted order, so the next
> record's key will not be the next (sorted) key.
> Am I understanding this correctly? And if you want to start at the
> beginning, you don't have a key. Do you use a key of "" to position to the
> beginning of the file?

No. The record keys are always stored sorted.
If you put in a random list of names: 
Zorro
Bubba
Norton
Chuck
Al

Then they will be stored in the database as:
1. Al
2.. Bubba
3. Chuck
4. Norton
5. Zorro

Therefore, to start at the beginning of the list, retrieve record 1,
For the list above, db_record_key(1) would return Al
db_record_key(db_table_size()) would return Zorro.

Regards,
Irv

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu