Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Custom writebuffer
Message
From
28/01/1997 16:37:10
Bill Gravell
Indoor Purification System
Menifee, California, United States
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00018427
Message ID:
00018609
Views:
33
>Hi,
>
>I'm having trouble with my custom write buffer.When I am on a record and make changes then go to the next record using my toolbar the writebuffer traps for changes and allows me to commit or revert my changes. But if I were to make changes then select my listbox and go to another record, the changes are already committed. How do I check if data has changed in any of my text boxes and prompt the user to save, discard or cancel the last action?
>
>TIA
>Jon

Jon, I've read some of the other responses, and I have experienced some of the same frustration. Remember that in row buffering, changes are committed when 1) you issue a tableupdate, or 2) when you move the record pointer. I decided on table buffering, because it does not update when the record pointer is moved. the following is a portion of code that I use to determine if changes have been made. the -1 argument returns a string that coresponds to the length of the record. A "2" will be in the string is an existing record, and a "4" will be in the string for an appended record. those characters will be in a postion that coresponds to the postion of the field that has changed. Thus, if a "2" or "4" is contained in ($) the string, then the record has been modified. This code is part of a larger section that does some other things, so that is why there is more there than necessary.

IF "2" $ GETFLDSTATE(-1) OR "4" $ GETFLDSTATE(-1)
lsuccess=TABLEUPDATE(.T.) && Commits changes
IF lsuccess
lsaved = .T.
ENDIF
ENDIF

HTH....Bill
Previous
Reply
Map
View

Click here to load this message in the networking platform