GetNextModified()
Boy, do we wish this function had been around forever! It provides an easy way to find all the records that have changed in an editing session. It works only with table-buffered data. Pass it a record number and it finds the next record after that that has changed.| Usage | nNextChanged = GetNextModified( nStart [, cAlias | nWorkArea ] [, lNoFire ] ) |
| Parameter | Value | Meaning |
| nStart | 0 | Find the first changed record in the table. |
| Positive number | Find the next changed record after record nStart. | |
| cAlias | Character | Look for changed records in the table open as cAlias. |
| Omitted | If nWorkArea is also omitted, look for changed records in the current work area. | |
| nWorkArea | Numeric | Look for changed records in work area nWorkArea. |
| Omitted | If cAlias is also omitted, look for changed records in the current work area. | |
| lNoFire | .T. | Do not fire field, table, and index uniqueness rules (new in VFP 7). |
| .F. or omitted | Rules are fired. | |
| nNextChanged | 0 | There are no changed records after record nStart. |
| Positive number | The record number of the next changed record. | |
| Negative number | The temporary record number of a newly added record. |
| Example | * Loop through an open table, finding all the changed records * and preventing rules from firing. nNextRec = GetNextModified(0, ALIAS(), .T.) DO WHILE nNextRec <> 0 IF nNextRec > 0 * This is an existing record. Check for conflicts. * Then save it. ELSE * This is a new record. Save it. ENDIF nNextRec = GetNextModified(nNextRec) ENDDO |
| See Also | Buffering, CurVal(), GetFldState(), OldVal(), SetFldState(), TableRevert(), TableUpdate() |
View Updates
Copyright © 2002 by Tamar E. Granor, Ted Roche, Doug Hennig, and Della Martin. All Rights Reserved.