in reply to
Re^3: finding next key in db_file
in thread finding next key in db_file
All in all, this sounds more like a job for MySQL for the fun sorting and data integrity. I think this would work just fine if the user always checked what the last element was before creating a new element.
You're right, it's not the most efficient way of going about it if there are large gaps.
"Age is nothing more than an inaccurate number bestowed upon us at birth as just another means for others to judge and classify us"