TABLEREVERT( ) Function

Example   See Also

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.

Syntax

TABLEREVERT([lAllRows [, cTableAlias | nWorkArea]])

Returns

Numeric

Arguments

lAllRows

Determines whether all changes made to the table or cursor are discarded. If lAllRows is true (.T.) and table buffering is enabled, changes made to all records are discarded in the table or cursor. If lAllRows is false (.F.) and table buffering is enabled, only changes made to the current record in the table or cursor are discarded.

If row buffering is enabled, the value of lAllRows is ignored and the changes made to the current record in the table or cursor are discarded.

The default value for lAllRows is false (.F.).

cTableAlias

Specifies the alias of the table or cursor in which the changes are discarded.

nWorkArea

Specifies the work area of the table or cursor in which the changes are discarded.

Remarks

TABLEREVERT( ) returns the number of records for which changes were discarded.

Note   On a network, the data currently on disk may differ from the data on disk when the table was opened or the cursor was created. Other users on the network may have changed the data after the table was opened or the cursor was created.

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, Visual FoxPro 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 cTableAlias or nWorkArea arguments.

TABLEREVERT( ) does not return the record pointer to its original position.