If a Visual FoxPro command has a Scope clause, you can specify a range of records for the command to act on.
The following table describes the clauses you can use for Scope.
Affects all records in the table.
Affects the next nExpr number of records beginning with the current record.
In the following example, the REPLACE command acts on the current record and the two following records:
REPLACE status WITH "open" NEXT 3
Affects only the specified record number.
Unlike the other scope clauses, which are relative to the number of records in the table and to the current position of the record pointer, the RECORD scope clause always acts on the specified physical record number. Therefore, RECORD nRecordNumber does not respect the values of SET FILTER or SET DELETED.
In the following example, the REPLACE command acts on record number 5:
REPLACE status WITH "open" RECORD 5
Affects a range of records beginning with the current record and ending with the last record in the table. In the following example, the REPLACE command stores a null value in the remaining records:
REPLACE status WITH .NULL. REST
You can also specify record ranges using FOR and WHILE clauses. For more information, see FOR Clauses and WHILE Clauses.