Discussion:
Index Sequence
(too old to reply)
Andy Trezise
2005-11-15 22:51:18 UTC
Permalink
I have a table that I open in buffer mode 4.

I switch from my form to another form (changing to the parent forms
DataSessionID - don't know if this is technicallly correct).

I then append a new record to my table....I don't use TABLEUPDATE at this
point....and return to the parent form.

The grid on that form shows the newly added record but it is not in the
correct index sequence. After a few seconds the grid seems to sort itself
out and the new record slots into it's correct position.

I assume that this is because of the table buffering but can't understand
why. I've tried a FLUSH but that has no effect (I suppose that's because
FLUSH only commits updated records ie. where you've done a tableupdate()).

Just wondered if anyone else had seen this behaviour and whether there was a
way around it.

I don't want to loose the functionality that buffering brings but it
sometimes seems more hassle than it's worth.
Olaf Doschke
2005-11-16 11:52:02 UTC
Permalink
Hi Andy,
Just wondered if anyone else had seen this behaviour and whether there was a way around it.
I don't want to loose the functionality that buffering brings but it sometimes seems more hassle than it's worth.
I'd say the grid has more to do with it, than the
buffering. If you refresh() the grid after adding the
new record, does it sort "immediately"?

Bye, Olaf.
Andy Trezise
2005-11-16 18:28:21 UTC
Permalink
Yes I refresh the grid but it has no immediate effect....it's not until you
scroll up / down etc that the sequence is corrected
Post by Olaf Doschke
Hi Andy,
Post by Andy Trezise
Just wondered if anyone else had seen this behaviour and whether there
was a way around it.
I don't want to loose the functionality that buffering brings but it
sometimes seems more hassle than it's worth.
I'd say the grid has more to do with it, than the
buffering. If you refresh() the grid after adding the
new record, does it sort "immediately"?
Bye, Olaf.
Fred Taylor
2005-11-17 01:17:36 UTC
Permalink
Try doing a GO RECNO() somewhere in your code, like where you're doing your
grid.Refresh() (just before it).
--
Fred
Microsoft Visual FoxPro MVP
Post by Andy Trezise
Yes I refresh the grid but it has no immediate effect....it's not until
you scroll up / down etc that the sequence is corrected
Post by Olaf Doschke
Hi Andy,
Post by Andy Trezise
Just wondered if anyone else had seen this behaviour and whether there
was a way around it.
I don't want to loose the functionality that buffering brings but it
sometimes seems more hassle than it's worth.
I'd say the grid has more to do with it, than the
buffering. If you refresh() the grid after adding the
new record, does it sort "immediately"?
Bye, Olaf.
Andy Trezise
2005-11-21 17:07:05 UTC
Permalink
That worked 1st time.....thanks very much.
Post by Fred Taylor
Try doing a GO RECNO() somewhere in your code, like where you're doing
your grid.Refresh() (just before it).
--
Fred
Microsoft Visual FoxPro MVP
Post by Andy Trezise
Yes I refresh the grid but it has no immediate effect....it's not until
you scroll up / down etc that the sequence is corrected
Post by Olaf Doschke
Hi Andy,
Post by Andy Trezise
Just wondered if anyone else had seen this behaviour and whether there
was a way around it.
I don't want to loose the functionality that buffering brings but it
sometimes seems more hassle than it's worth.
I'd say the grid has more to do with it, than the
buffering. If you refresh() the grid after adding the
new record, does it sort "immediately"?
Bye, Olaf.
Dennis Longfellow
2005-11-16 17:14:54 UTC
Permalink
Andy,

I see Olaf answered your refresh question.
Post by Andy Trezise
I switch from my form to another form (changing to the parent forms
DataSessionID - don't know if this is technicallly correct).
Correct but not necessary. All you need to do is let the second form use
the default data session, which will be the first form's data session at the
time you switch to the second form.

Dennis Longfellow
Loading...