eds record numbers - Ping Rob
- Posted by Pete Lomax <petelomax at blueyonder.co.uk> Feb 11, 2003
- 433 views
In database.htm, you write: > You can also access records directly, with no search, if you know the > current record number within the table. Record numbers are from 1 to > the length (current number of records), of the table.=20 I feel it would be instructive to note that record numbers are "fluid"; for example if you insert a record with key "2", it is naturally given record number 1. However, if you subsequently insert a record with key "1", then the record number of the newly inserted record is 1, and the first record now has record number 2. The most important point, as I just found out, is you cannot use the record number with any kind of persistence; obviously not storing it permanently on the data file, but critically not in a temporary local variable either. It also took me a while to realise that read next by key value is just get record number+1. Also, (again, just a documentation issue), db_find_key returns a negative key. It would be useful to include an example of partial key read using this technique. Lastly, In db_find_key you also write: > You can select a range of records by searching for the first and last > key values in the range. If those key values don't exist you'll get a > negative value showing where they would be if they existed.=20 Specifically, "can select a range" threw me, I think, well I'm lost anyway - can you explain this point further? Pete Something to keep you occupied waiting for bug reports on 2.4