CURVAL( ) Function

Example   See Also

Returns field values directly from disk for a table or a remote data source.

Syntax

CURVAL(cExpression [, cTableAlias | nWorkArea])

Returns

Character, Currency, Date, DateTime, Double, Float, Logical, Numeric, or Memo

Arguments

cExpression

Specifies an expression whose value CURVAL( ) returns from a table or a remote data source. cExpression is typically a field or an expression consisting of a set of fields from the table or remote data source.

cTableAlias

Specifies the alias of the table from which the field values are returned from disk for a table or a remote data source.

nWorkArea

Specifies the work area of the table from which the field values are returned from disk for a table or a remote data source.

Remarks

The field values returned by CURVAL( ) and OLDVAL( ) can be compared to determine if another user on a network changed the field values while the fields were being edited. CURVAL( ) and OLDVAL( ) can only return different values when optimistic row or table buffering is enabled. Optimistic row or table buffering is enabled with CURSORSETPROP( ).

Note   If you are working with a view in a multiuser environment, the values returned by CURVAL( ) might not be up to date unless you call the REFRESH( ) function first. Data returned by a view is buffered, and the CURVAL( ) function reads values from the buffer. However, if other users have changed data in the underlying tables for the view, the buffered data is not updated until the REFRESH( ) function is called.

CURVAL( ) returns field values for the current record, and the return value data type is determined by the expression you specify with cExpression.

The value is returned for the table or cursor open in the currently selected work area if CURVAL( ) is issued without the optional cTableAlias or nWorkArea arguments.