1. Re: EU Database

On Wednesday 15 August 2001 08:34, George Walters wrote:
>
> On 2nd thought if the pointers were not collapsed then the 'readnext' and
> 'readprev' would run into a hole. So it seems we need a better way to
> wander through a file. I'm open to any thoughts on how to deal with this.

George:

I think you may be looking at this from the wrong angle:

When you read the database by record(i), you're doing exactly the 
same thing as if you were reading the (i) 'th record from a file.
In this case, imagine a file which is automatically compacted 
whenever a record is deleted.

So if you have a "pointer" named current, and current = 10, 
and you're viewing the 10th record, when you delete record 10
then the record that used to be #11 is now the 10th record. 

That should cause no trouble, because you shouldn't 
be using "current" for any purpose other than navigating around 
the database. Just display the record that is now "current", 
i.e. the 10th, and don't change the value of "current". 
Unless you delete the last record in the table. 
Then you have to decrement "current" to avoid running over the end.

If you're using the current position as a key into other data files, then 
that's not a good idea. Not at all.  Contact me off the list if you need 
ideas on ways to do this.

Regards,
Irv

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu