1. EU Database delimma

The issue here is setting up a program that needs to 'readnext' or
'readprev' though a file doing maintenance to the file. consider the
following.

Customer's c5400,c5450,c5500,c5550,.......

I'm reading next through the file by incrementing the record pointer and
decide I need to delete c5450. EU then changes all the file pointers and
suffels them down from c5500. this breaks my read 'readnext' since
incrementing the record pointer would skip c5500. If on a delete record
function I decrement the pointer to fix the 'readnext' I would break the
'readprev'. It would seem that changing the record numbers on the fly is not
a good thing. Has anyone else figured a way to fix this Dilemma? I don't
know how I could write an update program to effectively deal with this. it
would be too confusing to keep a group of 'del' pointers for every db/table
than is open. Thoughts?

Rob is it necessary to suffle all the pointers down?

...george

new topic     » topic index » view message » categorize

2. Re: EU Database delimma

Thanks for your input. This is what I did. I positioned the record pointer
between the records. when a delete occurs I decrement the record pointer by
1/2 which positions the file pointer between the 2 records. I then use
appropriate floor and ceil functions on the 'readnext' and 'readprev' to
deal with it. Seems to work fine now.

Rob, you might consider making your current_db and current_table available
to the outside of your functions. It could be handy on the outside when a
lot of table/db switching is necessary by checking their values to see if a
switch is necessary..

...george

----- Original Message -----
From: "George Walters" <gwalters at sc.rr.com>
To: "EUforum" <EUforum at topica.com>
Sent: Wednesday, August 15, 2001 7:35 AM
Subject: EU Database delimma


> >
> The issue here is setting up a program that needs to 'readnext' or
> 'readprev' though a file doing maintenance to the file. consider the
> following.
>
> Customer's c5400,c5450,c5500,c5550,.......
>
> I'm reading next through the file by incrementing the record pointer and
> decide I need to delete c5450. EU then changes all the file pointers and
> suffels them down from c5500. this breaks my read 'readnext' since
> incrementing the record pointer would skip c5500. If on a delete record
> function I decrement the pointer to fix the 'readnext' I would break the
> 'readprev'. It would seem that changing the record numbers on the fly is
not
> a good thing. Has anyone else figured a way to fix this Dilemma? I don't
> know how I could write an update program to effectively deal with this. it
> would be too confusing to keep a group of 'del' pointers for every
db/table
> than is open. Thoughts?
>
> Rob is it necessary to suffle all the pointers down?
>
> ...george
>
> >
> >
>
>

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu