Click or drag to resize

SetFldState Function

X#
-- todo --
Assigns a field modification or deletion state value to a field or record in a table or cursor.

Namespace:  XSharp.VFP
Assembly:  XSharp.VFP (in XSharp.VFP.dll) Version: 2.19
Syntax
 FUNCTION SetFldState(
	uField,
	nFieldState,
	uArea
) AS LOGIC CLIPPER
Request Example View Source

Parameters

uField (Optional)
Type: Usual
nFieldState (Optional)
Type: Usual
uArea (Optional)
Type: Usual
Specifies the alias of the table or cursor in which the modification or deletion status is assigned.
Or
Specifies the work area of the table or cursor in which the modification or deletion status is assigned. The field modification or deletion state value is assigned for the table or cursor open in the currently selected work area if SetFLDState( ) is issued without the optional uArea arguments.

Return Value

Type: Logic
Logical
Remarks
X# uses field state values to determine which fields in tables or cursors are updated. SetFLDState( ) makes it possible for you to control which fields X# attempts to update, regardless of which fields have been modified in the table or cursor.
nFieldstateModification 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..
Examples
X#
 1Close Databases
 2Set MultiLocks ON  // Must be on for table buffering
 3Set PATH TO (HOME(2) + 'Data\')     // Sets path to database
 4Open Database testdata  // Open testdata database
 5Use Customer     // Open customer table
 6= CursorSetProp('Buffering', 5, 'customer')  // Enable table buffering
 7Clear
 8? GetFldState('cust_id')  // Displays 1, not modified
 9Replace cust_id    WITH '***'  // Changes field contents
10? GetFldState('cust_id')  // Returns 2, field modified
11= SetFLDState('cust_id', 1)  // Change the field status
12? GetFldState('cust_id')  // Displays 1, not modified
13= TableRevert(.T.)  // Discard all table changes
See Also