Robert - You will also have to eventually deal with the CURSORSETPROP() function which allows for row or table buffering to be in place in an app.
By default default, Buffering is disabled and all changes are written to disk file immediately, but there are 4 types of Buffering that can be used, and if so the changes are only written under different circumstances. The most aggressive (defensive) one (value 5) actually requires an explicit call to a function name TableUpdate() to write your changes to disk.
With level 5, you can modify multiple fields in multiples in a local cursor and the changes are not written to disk until TableUpdate() is called, and even then you can call TableUpdate() for the current row or all rows. You can also call TableRevert() to totally undo changes to current or or even all rows.
1 -> No buffering. The default value.
2 -> Pessimistic record locks which lock record now, update when pointer moves or upon TABLEUPDATE( ).
3 -> Optimistic record locks which wait until pointer moves, and then lock and update.
4 -> Pessimistic table locks which lock record now, update later upon TABLEUPDATE( ).
5 -> Optimistic table lock which wait until TABLEUPDATE( ), and then lock and update edited records.
TableUpdate()
Commits changes made to a buffered row, a buffered table, cursor, or cursor adapter.
Code: Select all
TABLEUPDATE( [nRows [, lForce]] [, cTableAlias | nWorkArea] [, cErrorArray] )
TableRevert()
Discards changes made to a buffered row or a buffered table or cursor and restores the OLDVAL( ) data for remote cursors and the current disk values for local tables and cursors.
Note - On a network, the data currently on disk might differ from the data on the disk when the table was opened or the cursor was created. Other users on the network might have changed the data after the table was opened or the cursor was created.
Code: Select all
TABLEREVERT( [lAllRows [, cTableAlias | nWorkArea] ] )
There are also 2 other functions
OldVal() and
CurValue() that come into play with apps that use Buffering, so add that to the list of thing to (eventually) address.
Search for "table buffering" on the Index tab of the FoxPro Help File chm, and start reading from there.