Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Table revert working inconsistently,

Status
Not open for further replies.

Filip Brnic

Programmer
Dec 25, 2023
42
RS
Hello, I have a button thats kind of like an undo, has a tablerevert() in it,
and i have a field
image_2024-06-25_111222237_ovo9qo.png

I was wondering, why when i change the last number and hit the tablerevert, it doesnt return to the number beforehand, but when i change any other number it does the tablereverting.
IS that connected to the textboxes, the table, or just the form in general?
 
TABLEREVERT is, as the name suggests, related to the table. More precisely it only works, once buffering is activated and reverts changes of the buffer back to the old value.

Therefore that feature only reverts changes made while the table was buffered, not any changes, and not all changes that occured at all previous times.

Chriss
 
Hey Chris thansk for the response, im still curios how do i solve this problem? Some fields that i have can be table reverted and some cannot. For example the Ziro racun field ive sent, do you have any idea what i could possibly do?
 
If some fields can be reverted, then all fields (of the same table) can be reverted. There is no selective buffering of only some fields possible.

So what you expereince must mean some fields are part of a buffered table, others not. If you want the tablerevert feature to work for all fields, look into CURSORSETPROP() function specifically the buffering and set all relevfant tables to a buffered state, so reverting can work at all, without buffering there also is no remembering of old values to revert to. Actually, if you try TABLEREVERT on an unbuffered workarea, you should get an error.

Chriss
 
Filip, I can't add much to the good advice Chris has already given you. But I would suggest you clarify one point.

You wrote:

when i change the last number and hit the tablerevert, it doesnt return to the number beforehand, but when i change any other number it does the tablereverting.

When you refer to the "last number", I assumed you meant the most recent value that was entered in the textbox. But now I wonder if what you really meant was the last digit - in this case, the "4" at the very right-hand end of the field.

If so, that changes things. It would have nothing to do with buffering - more to do with the data type of the field and the Picture or Format settings. But before going too far along that road, perhaps you clarify this point. What exactly do you mean by "last number"?

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top