GETFLDSTATE( ) Function

Example   See Also

Returns a numeric value indicating if a field in a table or cursor has been edited or had a record appended, or if the deleted status of the current record has been changed.

Syntax

GETFLDSTATE(cFieldName | nFieldNumber [, cTableAlias | nWorkArea])

Returns

Numeric

Arguments

cFieldName | nFieldNumber

Specifies the name of the field or the number of the field for which the edit status is returned. The field number nFieldNumber corresponds to the position of the field in the table or cursor structure. DISPLAY STRUCTURE or FIELD( ) can be used to determine a field's number.

You can specify –1 for nFieldNumber to return a character string consisting of deletion and edit status values for all fields in the table or cursor. For example, if a table has five fields and only the first field has been edited, GETFLDSTATE( ) returns the following:

121111

The 1 in the first position indicates the deletion status has not been changed.

You can also include 0 for nFieldNumber to determine if the deletion status of the current record has changed since the table or cursor was opened.

Note   Using GETFLDSTATE( ) only determines if the deletion status of the current record has changed. For example, if you mark a record for deletion and then recall it, GETFLDSTATE( ) indicates the deletion status has changed even though the record's deletion status has returned to its original state. Use DELETED( ) to determine the current deletion status of a record.

cTableAlias

Specifies the alias of the table or cursor for which the field edit or record deletion status is returned.

nWorkArea

Specifies the work area of the table or cursor for which the field edit or record deletion status is returned.

If you do not specify an alias or work area, GETFLDSTATE( ) returns a value for a field in the currently selected table or cursor.

Remarks

The following table lists the character return values and the corresponding edit or deletion status.

Return value Edit or deletion status
1 Field has not been edited or deletion status has not changed.
2 Field has been edited or deletion status has changed.
3 Field in an appended record has not been edited or deletion status has not changed for the appended record.
4 Field in an appended record has been edited or deletion status has changed for the appended record.

Row or table buffering must first be enabled with CURSORSETPROP( ) for GETFLDSTATE( ) to operate on local tables.

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