Click or drag to resize

Functions.GetFldState Method

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

Namespace:  XSharp.VFP
Assembly:  XSharp.VFP (in XSharp.VFP.dll) Version: 2.17
Syntax
 FUNCTION GetFldState(
	uField,
	uArea
) AS USUAL CLIPPER
Request Example View Source

Parameters

uField (Optional)
Type: Usual
Specifies the name of the field or the number of the field for which the modification 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 modification 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 changed, GetFldState( ) returns 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 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.
uArea (Optional)
Type: Usual
Specifies the alias of the table or cursor for which the field modification or record deletion status is returned.
Or
Specifies the work area of the table or cursor for which the field modification 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.

Return Value

Type: Usual
Numeric, Character, or .NULL.
Remarks
The following table lists the character return values and the corresponding modification or deletion status.
Return valueModification or deletion status
1Field has not been modified or deletion status has not changed.
2Field has been modified or deletion status has changed.
3Field in an appended record has not been modified or deletion status has not changed for the appended record.
4Field in an appended record has been modified or deletion status has changed for the appended record.
.NULL.At EOF( )
Row or table buffering must first be enabled with CursorSetProp( ) for GetFldState( ) to operate on local tables.
The modification or deletion status is returned for the table or cursor open in the currently selected work area if GetFldState( ) is issued without the optional uArea arguments.
Any change in a field will cause GetFldState() to return a value showing that the field has been modified, whether the change is explicit or implicit. An example of an explicit modification would be including the field in a Replace or Insert Into command. An implicit modification occurs in a field that has a default value when any command is issued that adds a new record.
See Also