TableRevert Function | |
-- todo --
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.
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.
Namespace:
XSharp.VFP
Assembly:
XSharp.VFP (in XSharp.VFP.dll) Version: 2.19
Syntax FUNCTION TableRevert(
lAllRows,
uArea
) AS LONG CLIPPER
[ClipperCallingConventionAttribute(new string[] { ... })]
public static int TableRevert(
Usual lAllRows = default,
Usual uArea = default
)
Request Example
View SourceParameters
- lAllRows (Optional)
- Type: Usual
Determines whether all changes made to the table or cursor are discarded. The following table describes the values for lAllRows.
lAllRows | Description |
---|
False (.F.) | If table buffering is enabled, only changes made to the current record in the table or cursor are discarded. (Default) |
True (.T.) | If table buffering is enabled, changes made to all records are discarded in the table or cursor. |
If row buffering is enabled, X# disregards the value of lAllRows, and changes made to the current record in the table or cursor are discarded.
- uArea (Optional)
- Type: Usual
Specifies the alias of the table or cursor in which the changes are discarded.
Or
Specifies the work area of the table or cursor in which the changes are discarded.
Return Value
Type:
Long
Numeric data type. TableRevert( ) returns the number of records for which changes were discarded.
Remarks
TableRevert( ) cannot discard changes made to a table or cursor that does not have row or table buffering enabled.
If you issue TableRevert( ) and row or table buffering is not enabled, X# generates an error message. Use CursorSetProp( ) to enable or
disable row and table buffering.
Changes are discarded in the table or cursor open in the currently selected work area if TableRevert( ) is issued without the optional
uArea arguments.
TableRevert( ) does not return the record pointer to its original position.
TableRevert( ) operates on CursorAdapter objects in the same way as other buffered cursors.
In X# 9.0, you cannot issue the TableRevert( ) function when a TableUpdate( ) is in operation.
Examples 1Close Databases
2Set MultiLocks ON
3Set PATH TO (HOME(2) + 'data\')
4Open Database testdata
5Use Customer
6= CursorSetProp('Buffering', 5, 'customer')
7Clear
8? 'Original cust_id value: '
9?? cust_id
10Replace cust_id WITH '***'
11? 'New cust_id value: '
12?? cust_id
13= TableRevert(.T.)
14? 'Reverted cust_id value: '
15?? cust_id
See Also