Click or drag to resize

GetNextModified Function

X#
-- todo --
Returns the record number for the next modified record in a buffered table or cursor.

Namespace:  XSharp.VFP
Assembly:  XSharp.VFP (in XSharp.VFP.dll) Version: 2.19
Syntax
 FUNCTION GetNextModified(
	nRecordNumber,
	uArea,
	lNoFire
) AS USUAL CLIPPER
Request Example View Source

Parameters

nRecordNumber (Optional)
Type: Usual
Specifies the record number after which GetNextModified( ) searches for the next modified record. Specify 0 for nRecordNumber to determine the first record in the table or cursor that has been modified.
uArea (Optional)
Type: Usual
Specifies the alias of the table or cursor for which GetNextModified( ) returns the number of the next modified record.
Or
Specifies the work area of the table or cursor for which GetNextModified( ) returns the number of the next modified record. If you do not specify an alias or work area, GetNextModified( ) returns the record number for the next modified record in the currently selected table or cursor.
lNoFire (Optional)
Type: Usual
Specifies that all firing of rules are suppressed.

Return Value

Type: Usual
Numeric
Remarks
GetNextModified( ) returns 0 if there are no modified records after the record you specify. Because of this, if you modify only one record, to verify its modification you must first use the GO TOP command to position the cursor before the changed record. A record is considered modified if the contents of any of its fields are changed in any way (even if the original field contents are restored) or the record's deletion status is changed.
GetNextModified( ) can operate only on tables and cursors for which table buffering is enabled. Table buffering is enabled with CursorSetProp( ).
Since triggers are unaffected by GetNextModified( ), lNoFire suppresses only field and record rules, and the "Uniqueness of index ID is violated" error. lNoFire prevents the flushing of temporary data, such as data stored in controls or updates made to the current record, to the underlying cursor.
Examples
X#
 1LOCAL lnCurRec
 2Clear
 3Close Databases
 4Open Database (HOME(2) + 'data\testdata')
 5Use Customer
 6* Enable table buffering.
 7Set MultiLocks ON
 8=CursorSetProp("Buffering", 5, "customer")
 9* Increase MAXORDAMT by 10% for customers in Mexico.
10Update Customer Set MaxOrdAmt=MaxOrdAmt * 1.1 Where Country = "Mexico"
11* Start with the first modified record.
12lnCurRec = <b>GetNextModified</b>(0)
13* DO until all modified records are processed.
14DO WHILE .T.
15* Move to the current modified record.
16GOTO (m.lnCurRec)
17* Process modified row here.
18? Customer.Company, Customer.MaxOrdAmt
19IF Customer.MaxOrdAmt > 8500
20=TableRevert(.F.)
21ENDIF
22?? Customer.MaxOrdAmt
23* Get the next modified record from here.
24lnCurRec = <b>GetNextModified</b>(m.lnCurRec)
25IF m.lnCurRec = 0 // No more modified records.
26EXIT
27ENDIF
28ENDDO
29=TableRevert(.T.)  // Restore sample data and discard all changes.
See Also